I needed a shelless SSH server that would not honor shell requests or exec commands, because I wanted to provide SFTP access without allowing shell access. I'm only posting this because this may be useful to people - I don't know Twisted very well, and there may be a better way to do it, but this works:
from zope import interface
(
Read more... )
Comments 2
if __name__ == '__main__':
....
I would love to try reusing this code but need more of this example.
Thanks
Reply
Looks like you forgot about SSH tunneling. Here's how you allow it:
self.channelLookup['direct-tcpip'] = twisted.conch.ssh.forwarding.openConnectForwardingClient
Now set a function that raises an exception, and you are done (=> connection gets closed). I have not yet figured out how to send an error message to the client.
Tests would be nice.
Reply
Leave a comment