[Twisted-Python] SSH server silently failing to open port
Hi, I'm still trying to get my SFTP server up. After looking over SFTPGateway in some detail, I think I have an idea of where all the pieces fit, but I'm still having the problem I had before with the sshsimpleserver example. Even though my factory is being instantiated and the log output says it's starting on the port I specified, the port is not, in fact, open to any connections. Because there is no error reported, I'm having a hard time debugging this. I know that my factory's __init__ method completes successfully, and startFactory is also called. After that... nothing. Can anyone help me figure out where to start looking, at least? Thanks, Jason Here's my Factory class, minus a few comments and debug print statements: class Factory(factory.SSHFactory): def __init__(self): self.portal = portal.Portal(Realm()) def makeConnection(*args, **kw): return Connection(*args, **kw) self.services = { 'ssh-userauth': userauth.SSHUserAuthServer, 'ssh-connection': makeConnection, } # TODO: replace this with keys loaded from a file self.__private_keys = { 'ssh-rsa': keys.getPublicKeyString(data=publicKey) } self.__public_keys = { 'ssh-rsa': keys.getPrivateKeyObject(data=privateKey) } def buildProtocol(self, address): # Note: this function does not use its address parameter. I don't know # why it's there. return factory.SSHFactory.buildProtocol(self, address) def getPrivateKeys(self): return self.__private_keys.copy() def getPublicKeys(self): return self.__public_keys.copy()
On Sun, 2004-09-12 at 17:53 -0500, Jason Stitt wrote:
Can anyone help me figure out where to start looking, at least?
It's hard to debug with just a class. A single file that demonstrates the problem (ideally a minimal example) is much better. -p -- Paul Swartz (o_ http://z3p.livejournal.com/ //\ z3p@twistedmatrix.com V_/_ AIM: z3penguin GPG:5CF0B1C9
On Sep 12, 2004, at 7:07 PM, Paul Swartz wrote:
On Sun, 2004-09-12 at 17:53 -0500, Jason Stitt wrote:
Can anyone help me figure out where to start looking, at least?
It's hard to debug with just a class. A single file that demonstrates the problem (ideally a minimal example) is much better.
The sshsimpleserver.py included with Twisted is a fairly minimal example. As I mentioned, that's where I first noticed this problem. It's in the doc/conch/examples directory in the latest SVN (the one on the Web site doesn't work, as we established on the SFTP thread, because of a bad import). I guess another question is: Does anybody else have this problem? Jason
On Sun, 2004-09-12 at 20:27 -0500, Jason Stitt wrote:
I guess another question is: Does anybody else have this problem?
I don't see it here (SVN head). Does this happen with other listening examples? Try doc/core/examples/echoserv.py and see if that works. -p -- Paul Swartz (o_ http://z3p.livejournal.com/ //\ z3p@twistedmatrix.com V_/_ AIM: z3penguin GPG:5CF0B1C9
On Sep 12, 2004, at 8:44 PM, Paul Swartz wrote:
On Sun, 2004-09-12 at 20:27 -0500, Jason Stitt wrote:
I guess another question is: Does anybody else have this problem?
I don't see it here (SVN head). Does this happen with other listening examples? Try doc/core/examples/echoserv.py and see if that works.
Yes. Plain echoserv works. Interestingly, the echoserv_ssl example in the same directory also works, whereas the conch/ssh example, which I tried again, still does not. I'll have to look into this. Perhaps I should try using reactor.listenSSL instead of conch. But would that even work at all with SFTP?
-p -- Paul Swartz (o_ http://z3p.livejournal.com/ //\ z3p@twistedmatrix.com V_/_ AIM: z3penguin GPG:5CF0B1C9 _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
On Sun, 2004-09-12 at 21:37 -0500, Jason Stitt wrote:
Yes. Plain echoserv works. Interestingly, the echoserv_ssl example in the same directory also works, whereas the conch/ssh example, which I tried again, still does not. I'll have to look into this. Perhaps I should try using reactor.listenSSL instead of conch. But would that even work at all with SFTP?
SFTP is just another protocol. It usually runs over a Conch-provided secure channel, but it will run over SSL or even a regular TCP connection. -p -- Paul Swartz (o_ http://z3p.livejournal.com/ //\ z3p@twistedmatrix.com V_/_ AIM: z3penguin GPG:5CF0B1C9
participants (2)
-
Jason Stitt
-
Paul Swartz