diff options
-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 |