[Twisted-Python] sshsimpleclient.py example
![](https://secure.gravatar.com/avatar/158d04cf1f67d8531e04f3c5bae3a21f.jpg?s=120&d=mm&r=g)
Hi Everyone, I'm new to using the twisted framework, so excuse me if this is a basic question.. When I run the sshsimpleclient.py example, to an external site, everything works fine (I just change the code to use my username and server information.) However, if I try to ssh to my localhost, it prints out the host key fingerprint, and then hangs.. never prompting for the password. Is there something different about trying to connect to localhost (I changed the code slightly, to take a command line parameter for the username/host..: if I use: python sshsimpleclient.py myuser@echoes.dhs.org it works perfectly if I use: python sshsimpleclient.py root@localhost it hangs. I am running Suse 9.1 Professional, and I can ssh to the host just using the regular openssh ssh exe. Thanks! And awesome job on Twisted! Mike Trosen
![](https://secure.gravatar.com/avatar/158d04cf1f67d8531e04f3c5bae3a21f.jpg?s=120&d=mm&r=g)
Jp, thanks for the info. I svn'd the latest stuff from the repository, built it and installed it, but now get an error if I try my localhost. The only thing I changed in the example program sshsimpleclient.py is I changed the USER var to be root, and the HOST variable to be localhost.. Thanks for the help! Michael Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/twisted/python/context.py", line 31, in callWithContext return func(*args,**kw) File "/usr/lib/python2.3/site-packages/twisted/internet/default.py", line 526, in _doReadOrWrite why = getattr(selectable, method)() File "/usr/lib/python2.3/site-packages/twisted/internet/tcp.py", line 244, in doRead return self.protocol.dataReceived(data) File "/usr/lib/python2.3/site-packages/twisted/conch/ssh/transport.py", line 189, in dataReceived ord(packet[0]), packet[1:]) --- <exception caught here> --- File "/usr/lib/python2.3/site-packages/twisted/python/log.py", line 53, in callWithLogger return callWithContext({"system": lp}, func, *args, **kw) File "/usr/lib/python2.3/site-packages/twisted/python/log.py", line 40, in callWithContext return context.call({ILogContext: newCtx}, func, *args, **kw) File "/usr/lib/python2.3/site-packages/twisted/python/context.py", line 31, in callWithContext return func(*args,**kw) File "/usr/lib/python2.3/site-packages/twisted/conch/ssh/service.py", line 42, in packetReceived f(packet) File "/usr/lib/python2.3/site-packages/twisted/conch/ssh/userauth.py", line 287, in ssh_USERAUTH_PK_OK d = self.getGenericAnswers(name, instruction, prompts) File "/usr/lib/python2.3/site-packages/twisted/conch/ssh/userauth.py", line 407, in getGenericAnswers raise NotImplementedError exceptions.NotImplementedError: On Thu, 26 Aug 2004 21:34:13 -0400, Jp Calderone <exarkun@divmod.com> wrote:
![](https://secure.gravatar.com/avatar/f2bb7225b5047991e87a44acf37e8373.jpg?s=120&d=mm&r=g)
On Thu, 2004-08-26 at 22:24 -0400, Michael Trosen wrote:
That error was caused by the example not having support for keyboard- interactive (usually attached to PAM) authentication. The example in r11475 has support for it. -p -- Paul Swartz (o_ http://z3p.livejournal.com/ //\ z3p@twistedmatrix.com V_/_ AIM: z3penguin GPG:5CF0B1C9
![](https://secure.gravatar.com/avatar/158d04cf1f67d8531e04f3c5bae3a21f.jpg?s=120&d=mm&r=g)
Jp, thanks for the info. I svn'd the latest stuff from the repository, built it and installed it, but now get an error if I try my localhost. The only thing I changed in the example program sshsimpleclient.py is I changed the USER var to be root, and the HOST variable to be localhost.. Thanks for the help! Michael Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/twisted/python/context.py", line 31, in callWithContext return func(*args,**kw) File "/usr/lib/python2.3/site-packages/twisted/internet/default.py", line 526, in _doReadOrWrite why = getattr(selectable, method)() File "/usr/lib/python2.3/site-packages/twisted/internet/tcp.py", line 244, in doRead return self.protocol.dataReceived(data) File "/usr/lib/python2.3/site-packages/twisted/conch/ssh/transport.py", line 189, in dataReceived ord(packet[0]), packet[1:]) --- <exception caught here> --- File "/usr/lib/python2.3/site-packages/twisted/python/log.py", line 53, in callWithLogger return callWithContext({"system": lp}, func, *args, **kw) File "/usr/lib/python2.3/site-packages/twisted/python/log.py", line 40, in callWithContext return context.call({ILogContext: newCtx}, func, *args, **kw) File "/usr/lib/python2.3/site-packages/twisted/python/context.py", line 31, in callWithContext return func(*args,**kw) File "/usr/lib/python2.3/site-packages/twisted/conch/ssh/service.py", line 42, in packetReceived f(packet) File "/usr/lib/python2.3/site-packages/twisted/conch/ssh/userauth.py", line 287, in ssh_USERAUTH_PK_OK d = self.getGenericAnswers(name, instruction, prompts) File "/usr/lib/python2.3/site-packages/twisted/conch/ssh/userauth.py", line 407, in getGenericAnswers raise NotImplementedError exceptions.NotImplementedError: On Thu, 26 Aug 2004 21:34:13 -0400, Jp Calderone <exarkun@divmod.com> wrote:
![](https://secure.gravatar.com/avatar/f2bb7225b5047991e87a44acf37e8373.jpg?s=120&d=mm&r=g)
On Thu, 2004-08-26 at 22:24 -0400, Michael Trosen wrote:
That error was caused by the example not having support for keyboard- interactive (usually attached to PAM) authentication. The example in r11475 has support for it. -p -- Paul Swartz (o_ http://z3p.livejournal.com/ //\ z3p@twistedmatrix.com V_/_ AIM: z3penguin GPG:5CF0B1C9
participants (3)
-
Jp Calderone
-
Michael Trosen
-
Paul Swartz