diff options
author | yvesf <yvesf-git@xapek.org> | 2011-03-11 20:34:53 +0100 |
---|---|---|
committer | yvesf <yvesf-git@xapek.org> | 2011-03-11 20:34:53 +0100 |
commit | affa0b49e97a7f8fb25d29c3dc90e5f0459b127d (patch) | |
tree | 70a6dd890de26cc994e3810c2d07c816e2f8f3e5 | |
parent | 550286de8802515b97358c9632f585677862a01b (diff) | |
download | offssh-affa0b49e97a7f8fb25d29c3dc90e5f0459b127d.tar.gz offssh-affa0b49e97a7f8fb25d29c3dc90e5f0459b127d.zip |
startskript
-rw-r--r-- | offssh.py (renamed from sshsimpleserver.py) | 11 | ||||
-rwxr-xr-x | start.sh | 5 |
2 files changed, 13 insertions, 3 deletions
diff --git a/sshsimpleserver.py b/offssh.py index 3254ef6..a5ac53a 100644 --- a/sshsimpleserver.py +++ b/offssh.py @@ -135,6 +135,11 @@ portal.registerChecker(passwdDB) portal.registerChecker(InMemoryPublicKeyChecker()) ExampleFactory.portal = portal -if __name__ == '__main__': - reactor.listenTCP(2222, ExampleFactory()) - reactor.run() +from twisted.application import service, internet +sshservice = internet.TCPServer(2222, ExampleFactory()) +application = service.Application('SSH Server', uid=65534, gid=65534) +sshservice.setServiceParent(application) + +#if __name__ == '__main__': +# reactor.listenTCP(2222, ExampleFactory()) +# reactor.run() diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..b367d91 --- /dev/null +++ b/start.sh @@ -0,0 +1,5 @@ +#!/bin/sh +uid=$(getent passwd nobody | cut -f 3 -d :) +gid=$(getent passwd nobody | cut -f 4 -d :) + +twistd --nodaemon -o --gid=$gid --uid=$uid -y offssh.py |