From challman at gmail.com Wed Aug 1 20:54:44 2007 From: challman at gmail.com (Chris Hallman) Date: Wed, 1 Aug 2007 23:54:44 -0400 Subject: [paramiko] Fwd: paramiko mailing list In-Reply-To: <18e3f33d0707270746o24abc187n2f902c1ec573340b@mail.gmail.com> References: <18e3f33d0707270746o24abc187n2f902c1ec573340b@mail.gmail.com> Message-ID: <9f68812f0708012054m15ae7635n97675d924cbb68cf@mail.gmail.com> fyi.... ---------- Forwarded message ---------- From: Eli Criffield Date: Jul 27, 2007 10:46 AM Subject: paramiko mailing list To: Chris Hallman Hey can you email the paramiko mailing list and let them know there having problems with there mailman page. I can't seem to get signed up I never get the confirmation email. Eli -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.lag.net/pipermail/paramiko/attachments/20070801/61654e27/attachment.htm From craig.strait at pnl.gov Thu Aug 2 09:27:11 2007 From: craig.strait at pnl.gov (Strait, Craig) Date: Thu, 2 Aug 2007 09:27:11 -0700 Subject: [paramiko] Fwd: paramiko mailing list References: <18e3f33d0707270746o24abc187n2f902c1ec573340b@mail.gmail.com> <9f68812f0708012054m15ae7635n97675d924cbb68cf@mail.gmail.com> Message-ID: <7ABADDD065D41B419B4B46076D4F44A2431A48@EMAIL01.pnl.gov> And I can't unsubscribe. ________________________________ From: paramiko-bounces at lag.net on behalf of Chris Hallman Sent: Wed 8/1/2007 8:54 PM To: paramiko at lag.net Subject: [paramiko] Fwd: paramiko mailing list fyi.... ---------- Forwarded message ---------- From: Eli Criffield Date: Jul 27, 2007 10:46 AM Subject: paramiko mailing list To: Chris Hallman Hey can you email the paramiko mailing list and let them know there having problems with there mailman page. I can't seem to get signed up I never get the confirmation email. Eli From titleistfour at gmail.com Mon Aug 6 07:13:34 2007 From: titleistfour at gmail.com (jay) Date: Mon, 6 Aug 2007 09:13:34 -0500 Subject: [paramiko] Testing an exception Message-ID: <7c25bb490708060713p1a5c38c3o9cad0530eac8351f@mail.gmail.com> Hello, Like to start off saying paramiko is fantastic and has been a huge time saver for me at work. Thanks for the hard work! I got the following traceback and am unsure what the problem is. Traceback (most recent call last): File "ATM.py", line 115, in t.connect(username=sftpRemoteUser, password=sftpRemotePassword) File "/usr/local/python251/lib/python2.5/site-packages/paramiko/transport.py", line 931, in connect self.start_client() File "/usr/local/python251/lib/python2.5/site-packages/paramiko/transport.py", line 398, in start_client raise e SSHException: Error reading SSH protocol banner I thought my code would catch all exceptions, but apparently not. This particular problem showed up inside this try: except Exception, e: So, I would like to try and duplicate it, but I'm not even sure what the problem was. Any suggestions on how to duplicate this problem and make sure the code catches it? Thanks Jay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.lag.net/pipermail/paramiko/attachments/20070806/3306ade3/attachment.htm From toddw at activestate.com Tue Aug 7 10:43:28 2007 From: toddw at activestate.com (Todd Whiteman) Date: Tue, 07 Aug 2007 10:43:28 -0700 Subject: [paramiko] Testing an exception In-Reply-To: <7c25bb490708060713p1a5c38c3o9cad0530eac8351f@mail.gmail.com> References: <7c25bb490708060713p1a5c38c3o9cad0530eac8351f@mail.gmail.com> Message-ID: <46B8AF40.5030003@activestate.com> Hi Jay, You get this exception from connecting to a remote machine on a non-ssh port, so when Paramiko tries to read in the relevant SSH information, it fails and raises the SSHException you received. A simple repro example is to try and connect to the ftp port (port 21) instead of the SSH port (port 22). Cheers, Todd jay wrote: > Hello, > > Like to start off saying paramiko is fantastic and has been a huge time > saver for me at work. Thanks for the hard work! > > I got the following traceback and am unsure what the problem is. > > Traceback (most recent call last): > File "ATM.py", line 115, in > t.connect(username=sftpRemoteUser, password=sftpRemotePassword) > File > "/usr/local/python251/lib/python2.5/site-packages/paramiko/transport.py", > line 931, in connect > self.start_client() > File > "/usr/local/python251/lib/python2.5/site-packages/paramiko/transport.py", > line 398, in start_client > raise e > SSHException: Error reading SSH protocol banner > > I thought my code would catch all exceptions, but apparently not. This > particular problem showed up inside this > > try: > except Exception, e: > > So, I would like to try and duplicate it, but I'm not even sure what the > problem was. Any suggestions on how to duplicate this problem and make > sure the code catches it? Thanks > > Jay > > > ------------------------------------------------------------------------ > > _______________________________________________ > paramiko mailing list > paramiko at lag.net > http://mail.lag.net/mailman/listinfo/paramiko From titleistfour at gmail.com Tue Aug 7 10:44:59 2007 From: titleistfour at gmail.com (jay) Date: Tue, 7 Aug 2007 12:44:59 -0500 Subject: [paramiko] Testing an exception In-Reply-To: <46B8AF40.5030003@activestate.com> References: <7c25bb490708060713p1a5c38c3o9cad0530eac8351f@mail.gmail.com> <46B8AF40.5030003@activestate.com> Message-ID: <7c25bb490708071044h1cc186cdsc65eb5fccc973dc@mail.gmail.com> Thanks Todd. Its interesting that I was connected to an ssh server on port 22. Nothing non standard about that. Could this also be a timeout related exception? If the remote server is slow to respond? Jay On 8/7/07, Todd Whiteman wrote: > > Hi Jay, > > You get this exception from connecting to a remote machine on a non-ssh > port, so when Paramiko tries to read in the relevant SSH information, it > fails and raises the SSHException you received. > > A simple repro example is to try and connect to the ftp port (port 21) > instead of the SSH port (port 22). > > Cheers, > Todd > > jay wrote: > > Hello, > > > > Like to start off saying paramiko is fantastic and has been a huge time > > saver for me at work. Thanks for the hard work! > > > > I got the following traceback and am unsure what the problem is. > > > > Traceback (most recent call last): > > File "ATM.py", line 115, in > > t.connect(username=sftpRemoteUser, password=sftpRemotePassword) > > File > > > "/usr/local/python251/lib/python2.5/site-packages/paramiko/transport.py", > > line 931, in connect > > self.start_client() > > File > > > "/usr/local/python251/lib/python2.5/site-packages/paramiko/transport.py", > > line 398, in start_client > > raise e > > SSHException: Error reading SSH protocol banner > > > > I thought my code would catch all exceptions, but apparently not. This > > particular problem showed up inside this > > > > try: > > except Exception, e: > > > > So, I would like to try and duplicate it, but I'm not even sure what the > > problem was. Any suggestions on how to duplicate this problem and make > > sure the code catches it? Thanks > > > > Jay > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > paramiko mailing list > > paramiko at lag.net > > http://mail.lag.net/mailman/listinfo/paramiko > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.lag.net/pipermail/paramiko/attachments/20070807/ebb6956f/attachment.htm From toddw at activestate.com Tue Aug 7 18:32:38 2007 From: toddw at activestate.com (Todd Whiteman) Date: Tue, 07 Aug 2007 18:32:38 -0700 Subject: [paramiko] Testing an exception In-Reply-To: <7c25bb490708071044h1cc186cdsc65eb5fccc973dc@mail.gmail.com> References: <7c25bb490708060713p1a5c38c3o9cad0530eac8351f@mail.gmail.com> <46B8AF40.5030003@activestate.com> <7c25bb490708071044h1cc186cdsc65eb5fccc973dc@mail.gmail.com> Message-ID: <46B91D36.3050501@activestate.com> Hi Jay, Yes, after looking at the code, a timeout is a case that generates the exception you describe. The timeout works like by reading the first line from the server (waiting up to 15 seconds by default) and then every subsequent banner line must be received within 2 seconds, otherwise you get that exception. The relevant code is below: def _check_banner(self): # this is slow, but we only have to do it once for i in range(5): # give them 15 seconds for the first line, then just 2 seconds # each additional line. (some sites have very high latency.) if i == 0: timeout = self.banner_timeout else: timeout = 2 try: buf = self.packetizer.readline(timeout) except Exception, x: raise SSHException('Error reading SSH protocol banner' + str(x)) if buf[:4] == 'SSH-': break Cheers, Todd jay wrote: > Thanks Todd. Its interesting that I was connected to an ssh server on > port 22. Nothing non standard about that. Could this also be a timeout > related exception? If the remote server is slow to respond? > > Jay > > On 8/7/07, *Todd Whiteman* > wrote: > > Hi Jay, > > You get this exception from connecting to a remote machine on a non-ssh > port, so when Paramiko tries to read in the relevant SSH information, it > fails and raises the SSHException you received. > > A simple repro example is to try and connect to the ftp port (port 21) > instead of the SSH port (port 22). > > Cheers, > Todd > > jay wrote: > > Hello, > > > > Like to start off saying paramiko is fantastic and has been a > huge time > > saver for me at work. Thanks for the hard work! > > > > I got the following traceback and am unsure what the problem is. > > > > Traceback (most recent call last): > > File "ATM.py", line 115, in > > t.connect(username=sftpRemoteUser, password=sftpRemotePassword) > > File > > > "/usr/local/python251/lib/python2.5/site-packages/paramiko/transport.py", > > line 931, in connect > > self.start_client() > > File > > > "/usr/local/python251/lib/python2.5/site-packages/paramiko/transport.py", > > line 398, in start_client > > raise e > > SSHException: Error reading SSH protocol banner > > > > I thought my code would catch all exceptions, but apparently > not. This > > particular problem showed up inside this > > > > try: > > except Exception, e: > > > > So, I would like to try and duplicate it, but I'm not even sure > what the > > problem was. Any suggestions on how to duplicate this problem > and make > > sure the code catches it? Thanks > > > > Jay > > > > > > > ------------------------------------------------------------------------ > > > > > _______________________________________________ > > paramiko mailing list > > paramiko at lag.net > > http://mail.lag.net/mailman/listinfo/paramiko > > > > ------------------------------------------------------------------------ > > _______________________________________________ > paramiko mailing list > paramiko at lag.net > http://mail.lag.net/mailman/listinfo/paramiko From titleistfour at gmail.com Wed Aug 8 06:05:10 2007 From: titleistfour at gmail.com (jay) Date: Wed, 8 Aug 2007 08:05:10 -0500 Subject: [paramiko] Testing an exception In-Reply-To: <46B91D36.3050501@activestate.com> References: <7c25bb490708060713p1a5c38c3o9cad0530eac8351f@mail.gmail.com> <46B8AF40.5030003@activestate.com> <7c25bb490708071044h1cc186cdsc65eb5fccc973dc@mail.gmail.com> <46B91D36.3050501@activestate.com> Message-ID: <7c25bb490708080605u1ca27cacg623469be3b75d741@mail.gmail.com> That makes more sense. The remote SSH server is VEEERY slow and login times can exceed 1 minute sometimes. Unfortunately, that server is out of my control. Thanks Jason On 8/7/07, Todd Whiteman wrote: > > Hi Jay, > > Yes, after looking at the code, a timeout is a case that generates the > exception you describe. The timeout works like by reading the first line > from the server (waiting up to 15 seconds by default) and then every > subsequent banner line must be received within 2 seconds, otherwise you > get that exception. The relevant code is below: > > > def _check_banner(self): > # this is slow, but we only have to do it once > for i in range(5): > # give them 15 seconds for the first line, then just 2 > seconds > # each additional line. (some sites have very high latency.) > if i == 0: > timeout = self.banner_timeout > else: > timeout = 2 > try: > buf = self.packetizer.readline(timeout) > except Exception, x: > raise SSHException('Error reading SSH protocol banner' > + str(x)) > if buf[:4] == 'SSH-': > break > > > Cheers, > Todd > > jay wrote: > > Thanks Todd. Its interesting that I was connected to an ssh server on > > port 22. Nothing non standard about that. Could this also be a timeout > > related exception? If the remote server is slow to respond? > > > > Jay > > > > On 8/7/07, *Todd Whiteman* > > wrote: > > > > Hi Jay, > > > > You get this exception from connecting to a remote machine on a > non-ssh > > port, so when Paramiko tries to read in the relevant SSH > information, it > > fails and raises the SSHException you received. > > > > A simple repro example is to try and connect to the ftp port (port > 21) > > instead of the SSH port (port 22). > > > > Cheers, > > Todd > > > > jay wrote: > > > Hello, > > > > > > Like to start off saying paramiko is fantastic and has been a > > huge time > > > saver for me at work. Thanks for the hard work! > > > > > > I got the following traceback and am unsure what the problem is. > > > > > > Traceback (most recent call last): > > > File "ATM.py", line 115, in > > > t.connect(username=sftpRemoteUser, > password=sftpRemotePassword) > > > File > > > > > > "/usr/local/python251/lib/python2.5/site-packages/paramiko/transport.py", > > > line 931, in connect > > > self.start_client() > > > File > > > > > > "/usr/local/python251/lib/python2.5/site-packages/paramiko/transport.py", > > > line 398, in start_client > > > raise e > > > SSHException: Error reading SSH protocol banner > > > > > > I thought my code would catch all exceptions, but apparently > > not. This > > > particular problem showed up inside this > > > > > > try: > > > except Exception, e: > > > > > > So, I would like to try and duplicate it, but I'm not even sure > > what the > > > problem was. Any suggestions on how to duplicate this problem > > and make > > > sure the code catches it? Thanks > > > > > > Jay > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > _______________________________________________ > > > paramiko mailing list > > > paramiko at lag.net > > > http://mail.lag.net/mailman/listinfo/paramiko > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > paramiko mailing list > > paramiko at lag.net > > http://mail.lag.net/mailman/listinfo/paramiko > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.lag.net/pipermail/paramiko/attachments/20070808/e3a3252a/attachment.htm From robey at lag.net Sun Aug 12 22:39:39 2007 From: robey at lag.net (Robey Pointer) Date: Sun, 12 Aug 2007 22:39:39 -0700 Subject: [paramiko] test message Message-ID: I moved the mailing list over to a new machine. Nothing should be different, except things might work better now. :) I know some people were saying they were having trouble subscribing or unsubscribing. If that's still true, please let me know and I'll debug it some more. robey From toon at warmerbythelake.com Sun Aug 12 23:57:49 2007 From: toon at warmerbythelake.com (Tod D. Ihde) Date: Mon, 13 Aug 2007 01:57:49 -0500 Subject: [paramiko] test message In-Reply-To: References: Message-ID: <46C000ED.5070902@warmerbythelake.com> Robey Pointer wrote: > I moved the mailing list over to a new machine. > Nothing should be different, except things might work better now. :) Oh, do I know THAT feeling! :) > I know some > people were saying they were having trouble subscribing or > unsubscribing. If that's still true, please let me know and I'll > debug it some more. > > robey > Yeah, I replied just to say that. Sorry. Hate me if you like :) Tod. From caleb at szatan.net Sat Aug 18 10:40:45 2007 From: caleb at szatan.net (caleb at szatan.net) Date: Sat, 18 Aug 2007 19:40:45 +0200 (CEST) Subject: [paramiko] simple ssh server Message-ID: <54525.157.158.0.30.1187458845.squirrel@jeremy.reps.pl> Hello i've got a simple problem. Just i wrote a simple client with paramiko like this: > import paramiko , getpass > user=raw_input('username: ') > pass=getpass.getpass('password: ') > client = paramiko.SSHClient() > client.load_system_host_keys() > client.connect('localhost',port=2200,username=user,password=pass) command="" > while command != 'exit': > command=raw_input('prompt: ') > stdin,stdout,stderr=client.exec_command(command) > for line in stdout: > print line.strip('\n') > for line in stderr: > if line: > print line.strip('\n') > client.close() > It works perfectly with standard OpenSSH server and similar. But I have to write my simple ssh server which it'll be working with this client. Examples included in Paramiko package maybe are too complicated for me, because i went to the dead end.. :) Is there any possibilities to someone show me a solution of this problem? please Help... Caleb From caleb at szatan.net Sat Aug 18 10:36:12 2007 From: caleb at szatan.net (caleb at szatan.net) Date: Sat, 18 Aug 2007 19:36:12 +0200 (CEST) Subject: [paramiko] simple ssh server Message-ID: <58976.157.158.0.30.1187458572.squirrel@jeremy.reps.pl> Hello i've got a simple problem. Just i wrote a simple client with paramiko like this: > import paramiko , getpass > user=raw_input('username: ') > pass=getpass.getpass('password: ') > client = paramiko.SSHClient() > client.load_system_host_keys() > client.connect('localhost',port=2200,username=user,password=pass) command="" > while command != 'exit': > command=raw_input('prompt: ') > stdin,stdout,stderr=client.exec_command(command) > for line in stdout: > print line.strip('\n') > for line in stderr: > if line: > print line.strip('\n') > client.close() > It works perfectly with standard OpenSSH server and similar. But I have to write my simple ssh server which it'll be working with this client. Examples included in Paramiko package maybe are too complicated for me, because i went to the dead end.. :) Is there any possibilities to someone show me a solution of this problem? please Help... Caleb From toddw at activestate.com Mon Aug 20 10:25:37 2007 From: toddw at activestate.com (Todd Whiteman) Date: Mon, 20 Aug 2007 10:25:37 -0700 Subject: [paramiko] simple ssh server In-Reply-To: <58976.157.158.0.30.1187458572.squirrel@jeremy.reps.pl> References: <58976.157.158.0.30.1187458572.squirrel@jeremy.reps.pl> Message-ID: <46C9CE91.3080507@activestate.com> Hi Caleb, It's likely because your trying to use the Python keyword "pass" when trying to store the password, which would give a "Syntax Error", use: password=getpass.getpass('password: ') client.connect('localhost',port=2200,username=user,password=password) Cheers, Todd caleb at szatan.net wrote: > Hello > > i've got a simple problem. Just i wrote a simple client with paramiko like > this: > > >> import paramiko , getpass >> user=raw_input('username: ') >> pass=getpass.getpass('password: ') >> client = paramiko.SSHClient() >> client.load_system_host_keys() >> client.connect('localhost',port=2200,username=user,password=pass) > command="" >> while command != 'exit': >> command=raw_input('prompt: ') >> stdin,stdout,stderr=client.exec_command(command) >> for line in stdout: >> print line.strip('\n') >> for line in stderr: >> if line: >> print line.strip('\n') >> client.close() >> > It works perfectly with standard OpenSSH server and similar. But I have to > write my simple ssh server > which it'll be working with this client. Examples included in Paramiko > package maybe are too complicated for me, > because i went to the dead end.. :) > Is there any possibilities to someone show me a solution of this problem? > > please Help... > > Caleb > From caleb at szatan.net Mon Aug 20 15:44:39 2007 From: caleb at szatan.net (caleb at szatan.net) Date: Tue, 21 Aug 2007 00:44:39 +0200 (CEST) Subject: [paramiko] simple ssh server Message-ID: <46429.157.158.0.30.1187649879.squirrel@jeremy.reps.pl> Hi. You misunderstood me :) unfortunately. i know that "pass" word is a Python word. My version of client working with OpenSSH server and similar. I've got problems with writing simple paramiko ssh server which it'll be compatible with this client. Please give me an example or a hint to solve. cheers. Caleb From toddw at activestate.com Mon Aug 20 16:24:33 2007 From: toddw at activestate.com (Todd Whiteman) Date: Mon, 20 Aug 2007 16:24:33 -0700 Subject: [paramiko] simple ssh server In-Reply-To: <46429.157.158.0.30.1187649879.squirrel@jeremy.reps.pl> References: <46429.157.158.0.30.1187649879.squirrel@jeremy.reps.pl> Message-ID: <46CA22B1.5030201@activestate.com> Hi Caleb, You still do not state what the problem is with writing the ssh server? Paramiko does provide many examples for writing your own SSH server (demos and test cases). Download the paramiko package, extract the files and take a look at the following: demos/demo_server.py tests/* Basically, you'll need to create a socket server that accepts connections and implements the "paramiko.ServerInterface" interface. Cheers, Todd caleb at szatan.net wrote: > Hi. > > You misunderstood me :) unfortunately. > > i know that "pass" word is a Python word. > My version of client working with OpenSSH server and similar. > I've got problems with writing simple paramiko ssh server which it'll be > compatible with this client. Please give me an example or a hint to solve. > > > cheers. > > Caleb > From jdsw2002 at yahoo.com Mon Aug 27 12:05:20 2007 From: jdsw2002 at yahoo.com (jd) Date: Mon, 27 Aug 2007 12:05:20 -0700 (PDT) Subject: [paramiko] Intermittent problem (no attachments) Message-ID: <789083.6587.qm@web35815.mail.mud.yahoo.com> Hi I had sent this email, but is waiting for approval as the attached sources seems to cross the limit of the distribution list. Can the owner kindly approve the message with files. does anyone have tips/pointers to resolve this ? Thanks /Jd --- jd wrote: > Hi Everyone. > I have written a ssh tunnel transport for > XML-RPC. > It seems to work pretty good, but has intermittent > failures. > > It seems that the client/parser missed the first > chunk of data from the server. > > This does not happen when I use the normal xml-rpc > over http. so I am assuming that the server is ok. > > Attached is test program that reproduces the > problem. > Environment is FC7, python 2.5, > python-paramiko-1.6.4-1.fc7, Xen 3.1 > > Can someone spot something wrong which might be > causing this ? Or some paramiko tweak that might be > useful in this scenario. > > Any other ideas on how to narrow down the problem > are > welcome. > > Thanks > /Jd > > === Attached description of files === > phelper.py : Just some utility wrapper over paramiko > lib. > test_proxy.py : simple driver program that > reproduces > the problem. > test_output : output : 2 out of N tries succeed. > XenServreProxy.py : Proxy that implements the > paramiko > transport for XML-RPC. > > > > > > > ____________________________________________________________________________________ > Sick sense of humor? Visit Yahoo! TV's > Comedy with an Edge to see what's on, when. > http://tv.yahoo.com/collections/222> #!/usr/bin/env python > # > # XenMan - Copyright (c) 2007 Jd & Hap Hazard > # ====== > # > # XenMan is a Xen management tool with a GTK based > graphical interface > # that allows for performing the standard set of > domain operations > # (start, stop, pause, kill, shutdown, reboot, > snapshot, etc...). It > # also attempts to simplify certain aspects such as > the creation of > # domains, as well as making the consoles available > directly within the > # tool's user interface. > # > # > # This software is subject to the GNU Lesser General > Public License (LGPL) > # and for details, please consult it at: > # > # http://www.fsf.org/licensing/licenses/lgpl.txt > # > # author : Jd > # > > import paramiko > from paramiko import SSHException > import os, sys > import getpass > import socket > > """Paramiko helper class. Provides common functions > as > -- validating host keys, > -- initializing a new transport, > -- agent based and password based authentication > etc. > """ > class HostValidationException(Exception): > def __init__(self, errno, description): > self.errno = errno > self.description = description > > def __repr__(self): > return "[Error %s], %s" % (self.errno, > self.description) > > def __str__(self): > return self.__repr__() > > class AuthenticationException(Exception): > def __init__(self, errno, description): > self.errno = errno > self.description = description > > def __repr__(self): > return "[Error %s], %s" % (self.errno, > self.description) > > def __str__(self): > return self.__repr__() > > > class CommunicationException(Exception): > def __init__(self, errno, description): > self.errno = errno > self.description = description > > def __repr__(self): > return "[Error %s], %s" % (self.errno, > self.description) > > def __str__(self): > return self.__repr__() > > > > class PHelper: > > host_keys = {} > > # credential helper > credentials_helper = None > > ## The credendital helper needs to > get_credentials(hostname) method > ## to return credentials > ## the object returned should: > ## get_username() and get_password() methods > ## This would be used when the transport can not > be initialized > ## using given methods > > @classmethod > def set_credentials_helper(cls, cred_helper): > """ Set the helper class""" > cls.credentials_helper = cred_helper > > > @classmethod > def load_keys(cls): > # TODO : May be we need to load > /etc/ssh/known_hosts and merge it here. > try: > path = > os.path.expanduser('~/.ssh/known_hosts') > cls.host_keys = > paramiko.util.load_host_keys(path) > except IOError: > try: > path = > os.path.expanduser('~/ssh/known_hosts') > cls.host_keys = > paramiko.util.load_host_keys(path) > except IOError: > pass > > > @classmethod > def init_log(cls,log_file_name): > paramiko.util.log_to_file(log_file_name) > > > @classmethod > def validate_host_key(cls, transport, hostname): > """ > get the remote hosts key and validate > against known host keys > throws exception with errno, reason > errno - reason > 1 - Host not found > 2. - Host found but key not found > 3 - Authentication failed (wrong password?) > 4 - Host found, key found, but keys do not > match > (server changed/spoofed) > """ > # check server's host key -- this is > important. > key = transport.get_remote_server_key() > if not PHelper.host_keys.has_key(hostname): > print "Warning : Host not found ! ", > hostname > #raise HostValidationException(1, "Host > not found") > elif not > PHelper.host_keys[hostname].has_key(key.get_name()): > print "Warning: Key not found ! ", > hostname > #raise HostValidationException(2, "Key > not found.") > elif > PHelper.host_keys[hostname][key.get_name()] != key: > raise HostValidationException(3, "Keys > mismatch for " + hostname) > > return True > > > ## TODO : only for testing purpose > @classmethod > def interactive_auth(cls, transport, username, > hostname): > default_auth = 'p' > auth = raw_input('Auth by (p)assword, (r)sa > key, or (d)ss key? [%s] ' % default_auth) > if len(auth) == 0: > auth = default_auth > > if auth == 'r': > default_path = > os.path.join(os.environ['HOME'], '.ssh', 'id_rsa') > path = raw_input('RSA key [%s]: ' % > default_path) > if len(path) == 0: > path = default_path > try: > key = > paramiko.RSAKey.from_private_key_file(path) > except > paramiko.PasswordRequiredException: > password = getpass.getpass('RSA key > password: ') > key = > paramiko.RSAKey.from_private_key_file(path, > password) > transport.auth_publickey(username, key) > elif auth == 'd': > default_path = > os.path.join(os.environ['HOME'], '.ssh', 'id_dsa') > path = raw_input('DSS key [%s]: ' % > default_path) > if len(path) == 0: > path = default_path > try: > key = > paramiko.DSSKey.from_private_key_file(path) > except > paramiko.PasswordRequiredException: > === message truncated ===> # This is a test program that reproduces the xml-rpc > over ssh_tunnel using > # paramiko. > > # The program works always when the protocol is > 'http' (python xml-rpc) > # but produces parsing errors when 'ssh_tunnel' is > used. > > # It seems that the client/parser is missing > first/some chunks > # and tries to parse from somewhere in the middle > producing the exception. > > # requires xen-utils / xen setup on the client > # requires xen setup on the server. > > from XenServerProxy import ServerProxy, > SSHTunnelTransport > from phelper import PHelper > import sys, traceback > > host = "192.168.12.103" > port = 8006 > username = 'root' > password = "password" > protocol = "ssh_tunnel" # "http" or "ssh_tunnel" > > if True: # interactive > print "Host name : [" , host , "]" > res = sys.stdin.readline() > if (res.strip() != ''): > host = res.strip() > > > > print "Port to tunnel to : [" , port , "]" > res = sys.stdin.readline() > if (res.strip() != ''): > port = int(res.strip()) > > > print "User name : [" , username , "]" > res = sys.stdin.readline() > if (res.strip() != ''): > username = res.strip() > > > print "Password : " > res = sys.stdin.readline() > if (res.strip() != ''): > password = res.strip() > > > print "Protocol : ssh_tunnel or http [" + > protocol + "] " > res = sys.stdin.readline() > if (res.strip() != ''): > protocol = res.strip() > > > ssh_transport = PHelper.init_ssh_transport(host, > > username=username, > > password=password) > if protocol == "ssh_tunnel": > tunnel_transport = SSHTunnelTransport(host, > port, > > ssh_transport = ssh_transport, > ssh_port = > 22) > else: > tunnel_transport = None > vmm = ServerProxy(protocol + '://' + username + > '@' + > host + ":" + > str(port) + > "/RPC2", > password=password, > transport=tunnel_transport > ) > > while True: > try: > info = vmm.xend.domains() > print info > except Exception, ex: > print traceback.print_exc() > > print "Type q to quit, any other key to request > again" > res = sys.stdin.readline() > if (res.strip() == 'q'): > break > > ssh_transport.close() > > > > > > #!/usr/bin/env python > # > # XenMan - Copyright (c) 2007 Jd & Hap Hazard > # ====== > # > # XenMan is a Xen management tool with a GTK based > graphical interface > # that allows for performing the standard set of > domain operations > # (start, stop, pause, kill, shutdown, reboot, > snapshot, etc...). It > # also attempts to simplify certain aspects such as > the creation of > # domains, as well as making the consoles available > directly within the > # tool's user interface. > # > # > # This software is subject to the GNU Lesser General > Public License (LGPL) > # and for details, please consult it at: > # > # http://www.fsf.org/licensing/licenses/lgpl.txt > # > # author : Jd > # > > from httplib import HTTPConnection, HTTP > from xmlrpclib import Transport > > from SimpleXMLRPCServer import SimpleXMLRPCServer, > SimpleXMLRPCRequestHandler > import xmlrpclib, socket, os, stat > import SocketServer > > > import xen.xend.XendClient > from xen.xend.XendLogging import log > > > > try: > from xen.util.xmlrpcclient import ServerProxy > base_pkg = xen.util.xmlrpcclient > except ImportError,e: > from xen.util.xmlrpclib2 import ServerProxy > base_pkg = xen.util.xmlrpclib2 > > from getpass import getuser > > from phelper import PHelper > import xml.parsers.expat > # A new ServerProxy that also supports ssh tunneling > using paramiko. > # The ssh_tunnel URL comes in the > # form: > # > # ssh_tunnel://user at host:port/RPC2 > # > # It assumes that the RPC handler is /RPC2. > # This is implemented in a fashion similar to other > transports in xmlrpcclient. > # Note : This one does not require corresponding > server side implementation > # as it uses the ssh tunneling mechanism. It > would be nice though to > # have another paramiko based server > implemeted and shipped by Xen > # to which we can directly connect. > > > DEFAULT_LOCAL_PORT_START = 2000 > DEFAULT_LOCAL_PORT_END = 2000 > > class SSHTunnelConnection(HTTPConnection): > def set_ssh_transport(self, ssh_transport): > self.ssh_transport = ssh_transport > > def set_local_port(self, localport): > self.localport = localport > > def connect(self): > # We already have a transport to the remote > machine. > # lets create a tunnel on the remote node to > forward traffic from > # localhost, localport ==> localhost, xen > port > # (NOTE : localhost is interpreted on the > remote node.) > self.sock = > PHelper.open_channel(self.ssh_transport, > "direct-tcpip", > > ("localhost",self.port), > > ("localhost",self.localport)) > > class SSHTunnel(HTTP): > > _connection_class = SSHTunnelConnection > > def __init__(self, ssh_transport, host='', > port=None, strict=None, > > localport=DEFAULT_LOCAL_PORT_START): > self.localport = localport > self.ssh_transport = ssh_transport > HTTP.__init__(self, host, port, strict) > > # take this oppertunity to associate transport > with the connection. > def _setup(self, conn): > HTTP._setup(self, conn) > conn.set_ssh_transport(self.ssh_transport) > conn.set_local_port(self.localport) > > > > class SSHTunnelTransport(Transport): > > current_local_port = DEFAULT_LOCAL_PORT_START > _use_datetime = False > > def __init__(self,hostname,port,user=None, > password=None, > ssh_transport=None, ssh_port=22): > """ constructor, takes in host and port to > which the tunnel > is to be opened. Assumes ssh on 22 for > now. > An already authenticated paramiko > transport can be passed. > It is assumed that the transport is to > the same host as specified > by hostname. > """ > self.hostname = hostname > self.ssh_port = ssh_port > self.username = user > self.port = port > self.transport_created=False > if ssh_transport == None: > self.transport = > PHelper.init_ssh_transport(self.hostname, > > self.ssh_port, > > username=self.username, > > password = password) > self.transport_created=True > else: > self.transport = ssh_transport > > > def request(self, host, handler, request_body, > verbose=0): > self.__handler = handler > return Transport.request(self, host, > '/RPC2', request_body, verbose) > > def make_connection(self, host): > """ return the connection paramiko connection > object """ > SSHTunnelTransport.current_local_port += 1 > if SSHTunnelTransport.current_local_port >= > DEFAULT_LOCAL_PORT_END: > SSHTunnelTransport.current_local_port = > DEFAULT_LOCAL_PORT_START > > return SSHTunnel(self.transport,host, > > localport=SSHTunnelTransport.current_local_port) > > > def cleanup(self): > """ clean up transport if we created it.""" > if self.transport != None and > self.transport_created: > self.transport.close() > > > > ## copied _Method from xmlrpc and > class _Dispatcher: > # some magic to bind an XML-RPC method to an RPC > server. > # supports "nested" methods (e.g. > examples.getStateName) > def __init__(self, orig_object, send, name): > self.__send = send > self.__name = name > self.__orig_object = orig_object > def __getattr__(self, name): > return _Dispatcher(self.__orig_object, > self.__send, "%s.%s" % > (self.__name, name)) > def __call__(self, *args): > try: > ret = self.__send(self.__name, args) > === message truncated === ____________________________________________________________________________________ Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 From toddw at activestate.com Mon Aug 27 13:07:48 2007 From: toddw at activestate.com (Todd Whiteman) Date: Mon, 27 Aug 2007 13:07:48 -0700 Subject: [paramiko] Intermittent problem (no attachments) In-Reply-To: <789083.6587.qm@web35815.mail.mud.yahoo.com> References: <789083.6587.qm@web35815.mail.mud.yahoo.com> Message-ID: <46D32F14.8070506@activestate.com> Hi Jd, First off, does this problem also exist when using the latest paramiko release (1.7.1): http://www.lag.net/paramiko/ Todd. jd wrote: > Hi > I had sent this email, but is waiting for approval > as the attached sources seems to cross the limit of > the distribution list. > Can the owner kindly approve the message with files. > does anyone have tips/pointers to resolve this ? > Thanks > /Jd > > --- jd wrote: > >> Hi Everyone. >> I have written a ssh tunnel transport for >> XML-RPC. >> It seems to work pretty good, but has intermittent >> failures. >> >> It seems that the client/parser missed the first >> chunk of data from the server. >> >> This does not happen when I use the normal xml-rpc >> over http. so I am assuming that the server is ok. >> >> Attached is test program that reproduces the >> problem. >> Environment is FC7, python 2.5, >> python-paramiko-1.6.4-1.fc7, Xen 3.1 >> >> Can someone spot something wrong which might be >> causing this ? Or some paramiko tweak that might be >> useful in this scenario. >> >> Any other ideas on how to narrow down the problem >> are >> welcome. >> >> Thanks >> /Jd >> >> === Attached description of files === >> phelper.py : Just some utility wrapper over paramiko >> lib. >> test_proxy.py : simple driver program that >> reproduces >> the problem. >> test_output : output : 2 out of N tries succeed. >> XenServreProxy.py : Proxy that implements the >> paramiko >> transport for XML-RPC. >> >> >> >> >> >> >> > ____________________________________________________________________________________ >> Sick sense of humor? Visit Yahoo! TV's >> Comedy with an Edge to see what's on, when. >> http://tv.yahoo.com/collections/222> #!/usr/bin/env > python >> # >> # XenMan - Copyright (c) 2007 Jd & Hap Hazard >> # ====== >> # >> # XenMan is a Xen management tool with a GTK based >> graphical interface >> # that allows for performing the standard set of >> domain operations >> # (start, stop, pause, kill, shutdown, reboot, >> snapshot, etc...). It >> # also attempts to simplify certain aspects such as >> the creation of >> # domains, as well as making the consoles available >> directly within the >> # tool's user interface. >> # >> # >> # This software is subject to the GNU Lesser General >> Public License (LGPL) >> # and for details, please consult it at: >> # >> # http://www.fsf.org/licensing/licenses/lgpl.txt >> # >> # author : Jd >> # >> >> import paramiko >> from paramiko import SSHException >> import os, sys >> import getpass >> import socket >> >> """Paramiko helper class. Provides common functions >> as >> -- validating host keys, >> -- initializing a new transport, >> -- agent based and password based authentication >> etc. >> """ >> class HostValidationException(Exception): >> def __init__(self, errno, description): >> self.errno = errno >> self.description = description >> >> def __repr__(self): >> return "[Error %s], %s" % (self.errno, >> self.description) >> >> def __str__(self): >> return self.__repr__() >> >> class AuthenticationException(Exception): >> def __init__(self, errno, description): >> self.errno = errno >> self.description = description >> >> def __repr__(self): >> return "[Error %s], %s" % (self.errno, >> self.description) >> >> def __str__(self): >> return self.__repr__() >> >> >> class CommunicationException(Exception): >> def __init__(self, errno, description): >> self.errno = errno >> self.description = description >> >> def __repr__(self): >> return "[Error %s], %s" % (self.errno, >> self.description) >> >> def __str__(self): >> return self.__repr__() >> >> >> >> class PHelper: >> >> host_keys = {} >> >> # credential helper >> credentials_helper = None >> >> ## The credendital helper needs to >> get_credentials(hostname) method >> ## to return credentials >> ## the object returned should: >> ## get_username() and get_password() methods >> ## This would be used when the transport can not >> be initialized >> ## using given methods >> >> @classmethod >> def set_credentials_helper(cls, cred_helper): >> """ Set the helper class""" >> cls.credentials_helper = cred_helper >> >> >> @classmethod >> def load_keys(cls): >> # TODO : May be we need to load >> /etc/ssh/known_hosts and merge it here. >> try: >> path = >> os.path.expanduser('~/.ssh/known_hosts') >> cls.host_keys = >> paramiko.util.load_host_keys(path) >> except IOError: >> try: >> path = >> os.path.expanduser('~/ssh/known_hosts') >> cls.host_keys = >> paramiko.util.load_host_keys(path) >> except IOError: >> pass >> >> >> @classmethod >> def init_log(cls,log_file_name): >> paramiko.util.log_to_file(log_file_name) >> >> >> @classmethod >> def validate_host_key(cls, transport, hostname): >> """ >> get the remote hosts key and validate >> against known host keys >> throws exception with errno, reason >> errno - reason >> 1 - Host not found >> 2. - Host found but key not found >> 3 - Authentication failed (wrong password?) >> 4 - Host found, key found, but keys do not >> match >> (server changed/spoofed) >> """ >> # check server's host key -- this is >> important. >> key = transport.get_remote_server_key() >> if not PHelper.host_keys.has_key(hostname): >> print "Warning : Host not found ! ", >> hostname >> #raise HostValidationException(1, "Host >> not found") >> elif not >> PHelper.host_keys[hostname].has_key(key.get_name()): >> print "Warning: Key not found ! ", >> hostname >> #raise HostValidationException(2, "Key >> not found.") >> elif >> PHelper.host_keys[hostname][key.get_name()] != key: >> raise HostValidationException(3, "Keys >> mismatch for " + hostname) >> >> return True >> >> >> ## TODO : only for testing purpose >> @classmethod >> def interactive_auth(cls, transport, username, >> hostname): >> default_auth = 'p' >> auth = raw_input('Auth by (p)assword, (r)sa >> key, or (d)ss key? [%s] ' % default_auth) >> if len(auth) == 0: >> auth = default_auth >> >> if auth == 'r': >> default_path = >> os.path.join(os.environ['HOME'], '.ssh', 'id_rsa') >> path = raw_input('RSA key [%s]: ' % >> default_path) >> if len(path) == 0: >> path = default_path >> try: >> key = >> paramiko.RSAKey.from_private_key_file(path) >> except >> paramiko.PasswordRequiredException: >> password = getpass.getpass('RSA key >> password: ') >> key = >> paramiko.RSAKey.from_private_key_file(path, >> password) >> transport.auth_publickey(username, key) >> elif auth == 'd': >> default_path = >> os.path.join(os.environ['HOME'], '.ssh', 'id_dsa') >> path = raw_input('DSS key [%s]: ' % >> default_path) >> if len(path) == 0: >> path = default_path >> try: >> key = >> paramiko.DSSKey.from_private_key_file(path) >> except >> paramiko.PasswordRequiredException: >> > === message truncated ===> # This is a test program > that reproduces the xml-rpc >> over ssh_tunnel using >> # paramiko. >> >> # The program works always when the protocol is >> 'http' (python xml-rpc) >> # but produces parsing errors when 'ssh_tunnel' is >> used. >> >> # It seems that the client/parser is missing >> first/some chunks >> # and tries to parse from somewhere in the middle >> producing the exception. >> >> # requires xen-utils / xen setup on the client >> # requires xen setup on the server. >> >> from XenServerProxy import ServerProxy, >> SSHTunnelTransport >> from phelper import PHelper >> import sys, traceback >> >> host = "192.168.12.103" >> port = 8006 >> username = 'root' >> password = "password" >> protocol = "ssh_tunnel" # "http" or "ssh_tunnel" >> >> if True: # interactive >> print "Host name : [" , host , "]" >> res = sys.stdin.readline() >> if (res.strip() != ''): >> host = res.strip() >> >> >> >> print "Port to tunnel to : [" , port , "]" >> res = sys.stdin.readline() >> if (res.strip() != ''): >> port = int(res.strip()) >> >> >> print "User name : [" , username , "]" >> res = sys.stdin.readline() >> if (res.strip() != ''): >> username = res.strip() >> >> >> print "Password : " >> res = sys.stdin.readline() >> if (res.strip() != ''): >> password = res.strip() >> >> >> print "Protocol : ssh_tunnel or http [" + >> protocol + "] " >> res = sys.stdin.readline() >> if (res.strip() != ''): >> protocol = res.strip() >> >> >> ssh_transport = PHelper.init_ssh_transport(host, >> >> username=username, >> >> password=password) >> if protocol == "ssh_tunnel": >> tunnel_transport = SSHTunnelTransport(host, >> port, >> >> ssh_transport = ssh_transport, >> ssh_port = >> 22) >> else: >> tunnel_transport = None >> vmm = ServerProxy(protocol + '://' + username + >> '@' + >> host + ":" + >> str(port) + >> "/RPC2", >> password=password, >> transport=tunnel_transport >> ) >> >> while True: >> try: >> info = vmm.xend.domains() >> print info >> except Exception, ex: >> print traceback.print_exc() >> >> print "Type q to quit, any other key to request >> again" >> res = sys.stdin.readline() >> if (res.strip() == 'q'): >> break >> >> ssh_transport.close() >> >> >> >> >>> #!/usr/bin/env python >> # >> # XenMan - Copyright (c) 2007 Jd & Hap Hazard >> # ====== >> # >> # XenMan is a Xen management tool with a GTK based >> graphical interface >> # that allows for performing the standard set of >> domain operations >> # (start, stop, pause, kill, shutdown, reboot, >> snapshot, etc...). It >> # also attempts to simplify certain aspects such as >> the creation of >> # domains, as well as making the consoles available >> directly within the >> # tool's user interface. >> # >> # >> # This software is subject to the GNU Lesser General >> Public License (LGPL) >> # and for details, please consult it at: >> # >> # http://www.fsf.org/licensing/licenses/lgpl.txt >> # >> # author : Jd >> # >> >> from httplib import HTTPConnection, HTTP >> from xmlrpclib import Transport >> >> from SimpleXMLRPCServer import SimpleXMLRPCServer, >> SimpleXMLRPCRequestHandler >> import xmlrpclib, socket, os, stat >> import SocketServer >> >> >> import xen.xend.XendClient >> from xen.xend.XendLogging import log >> >> >> >> try: >> from xen.util.xmlrpcclient import ServerProxy >> base_pkg = xen.util.xmlrpcclient >> except ImportError,e: >> from xen.util.xmlrpclib2 import ServerProxy >> base_pkg = xen.util.xmlrpclib2 >> >> from getpass import getuser >> >> from phelper import PHelper >> import xml.parsers.expat >> # A new ServerProxy that also supports ssh tunneling >> using paramiko. >> # The ssh_tunnel URL comes in the >> # form: >> # >> # ssh_tunnel://user at host:port/RPC2 >> # >> # It assumes that the RPC handler is /RPC2. >> # This is implemented in a fashion similar to other >> transports in xmlrpcclient. >> # Note : This one does not require corresponding >> server side implementation >> # as it uses the ssh tunneling mechanism. It >> would be nice though to >> # have another paramiko based server >> implemeted and shipped by Xen >> # to which we can directly connect. >> >> >> DEFAULT_LOCAL_PORT_START = 2000 >> DEFAULT_LOCAL_PORT_END = 2000 >> >> class SSHTunnelConnection(HTTPConnection): >> def set_ssh_transport(self, ssh_transport): >> self.ssh_transport = ssh_transport >> >> def set_local_port(self, localport): >> self.localport = localport >> >> def connect(self): >> # We already have a transport to the remote >> machine. >> # lets create a tunnel on the remote node to >> forward traffic from >> # localhost, localport ==> localhost, xen >> port >> # (NOTE : localhost is interpreted on the >> remote node.) >> self.sock = >> PHelper.open_channel(self.ssh_transport, >> "direct-tcpip", >> >> ("localhost",self.port), >> >> ("localhost",self.localport)) >> >> class SSHTunnel(HTTP): >> >> _connection_class = SSHTunnelConnection >> >> def __init__(self, ssh_transport, host='', >> port=None, strict=None, >> >> localport=DEFAULT_LOCAL_PORT_START): >> self.localport = localport >> self.ssh_transport = ssh_transport >> HTTP.__init__(self, host, port, strict) >> >> # take this oppertunity to associate transport >> with the connection. >> def _setup(self, conn): >> HTTP._setup(self, conn) >> conn.set_ssh_transport(self.ssh_transport) >> conn.set_local_port(self.localport) >> >> >> >> class SSHTunnelTransport(Transport): >> >> current_local_port = DEFAULT_LOCAL_PORT_START >> _use_datetime = False >> >> def __init__(self,hostname,port,user=None, >> password=None, >> ssh_transport=None, ssh_port=22): >> """ constructor, takes in host and port to >> which the tunnel >> is to be opened. Assumes ssh on 22 for >> now. >> An already authenticated paramiko >> transport can be passed. >> It is assumed that the transport is to >> the same host as specified >> by hostname. >> """ >> self.hostname = hostname >> self.ssh_port = ssh_port >> self.username = user >> self.port = port >> self.transport_created=False >> if ssh_transport == None: >> self.transport = >> PHelper.init_ssh_transport(self.hostname, >> >> self.ssh_port, >> >> username=self.username, >> >> password = password) >> self.transport_created=True >> else: >> self.transport = ssh_transport >> >> >> def request(self, host, handler, request_body, >> verbose=0): >> self.__handler = handler >> return Transport.request(self, host, >> '/RPC2', request_body, verbose) >> >> def make_connection(self, host): >> """ return the connection paramiko connection >> object """ >> SSHTunnelTransport.current_local_port += 1 >> if SSHTunnelTransport.current_local_port >= >> DEFAULT_LOCAL_PORT_END: >> SSHTunnelTransport.current_local_port = >> DEFAULT_LOCAL_PORT_START >> >> return SSHTunnel(self.transport,host, >> >> localport=SSHTunnelTransport.current_local_port) >> >> >> def cleanup(self): >> """ clean up transport if we created it.""" >> if self.transport != None and >> self.transport_created: >> self.transport.close() >> >> >> >> ## copied _Method from xmlrpc and >> class _Dispatcher: >> # some magic to bind an XML-RPC method to an RPC >> server. >> # supports "nested" methods (e.g. >> examples.getStateName) >> def __init__(self, orig_object, send, name): >> self.__send = send >> self.__name = name >> self.__orig_object = orig_object >> def __getattr__(self, name): >> return _Dispatcher(self.__orig_object, >> self.__send, "%s.%s" % >> (self.__name, name)) >> def __call__(self, *args): >> try: >> ret = self.__send(self.__name, args) >> > === message truncated === > > > > ____________________________________________________________________________________ > Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 > > > _______________________________________________ > paramiko mailing list > paramiko at www.lag.net > http://www.lag.net/cgi-bin/mailman/listinfo/paramiko > From jdsw2002 at yahoo.com Mon Aug 27 23:13:24 2007 From: jdsw2002 at yahoo.com (jd) Date: Mon, 27 Aug 2007 23:13:24 -0700 (PDT) Subject: [paramiko] Intermittent problem (no attachments) In-Reply-To: <46D32F14.8070506@activestate.com> Message-ID: <717504.91295.qm@web35812.mail.mud.yahoo.com> Got the latest 1.7.1 tar ball. Replaced paramiko dir under python2.4/site-packages/paramiko with the tar content (on this machine I have python 2.4) Still the problem reproduces. /Jd --- Todd Whiteman wrote: > Hi Jd, > > First off, does this problem also exist when using > the latest paramiko > release (1.7.1): > http://www.lag.net/paramiko/ > > Todd. > > jd wrote: > > Hi > > I had sent this email, but is waiting for > approval > > as the attached sources seems to cross the limit > of > > the distribution list. > > Can the owner kindly approve the message with > files. > > does anyone have tips/pointers to resolve this ? > > Thanks > > /Jd > > > > --- jd wrote: > > > >> Hi Everyone. > >> I have written a ssh tunnel transport for > >> XML-RPC. > >> It seems to work pretty good, but has > intermittent > >> failures. > >> > >> It seems that the client/parser missed the first > >> chunk of data from the server. > >> > >> This does not happen when I use the normal > xml-rpc > >> over http. so I am assuming that the server is > ok. > >> > >> Attached is test program that reproduces the > >> problem. > >> Environment is FC7, python 2.5, > >> python-paramiko-1.6.4-1.fc7, Xen 3.1 > >> > >> Can someone spot something wrong which might be > >> causing this ? Or some paramiko tweak that might > be > >> useful in this scenario. > >> > >> Any other ideas on how to narrow down the problem > >> are > >> welcome. > >> > >> Thanks > >> /Jd > >> > >> === Attached description of files === > >> phelper.py : Just some utility wrapper over > paramiko > >> lib. > >> test_proxy.py : simple driver program that > >> reproduces > >> the problem. > >> test_output : output : 2 out of N tries succeed. > >> XenServreProxy.py : Proxy that implements the > >> paramiko > >> transport for XML-RPC. > >> > >> > >> > >> > >> > >> > >> > > > ____________________________________________________________________________________ > >> Sick sense of humor? Visit Yahoo! TV's > >> Comedy with an Edge to see what's on, when. > >> http://tv.yahoo.com/collections/222> > #!/usr/bin/env > > python > >> # > >> # XenMan - Copyright (c) 2007 Jd & Hap > Hazard > >> # ====== > >> # > >> # XenMan is a Xen management tool with a GTK > based > >> graphical interface > >> # that allows for performing the standard set of > >> domain operations > >> # (start, stop, pause, kill, shutdown, reboot, > >> snapshot, etc...). It > >> # also attempts to simplify certain aspects such > as > >> the creation of > >> # domains, as well as making the consoles > available > >> directly within the > >> # tool's user interface. > >> # > >> # > >> # This software is subject to the GNU Lesser > General > >> Public License (LGPL) > >> # and for details, please consult it at: > >> # > >> # > http://www.fsf.org/licensing/licenses/lgpl.txt > >> # > >> # author : Jd > >> # > >> > >> import paramiko > >> from paramiko import SSHException > >> import os, sys > >> import getpass > >> import socket > >> > >> """Paramiko helper class. Provides common > functions > >> as > >> -- validating host keys, > >> -- initializing a new transport, > >> -- agent based and password based > authentication > >> etc. > >> """ > >> class HostValidationException(Exception): > >> def __init__(self, errno, description): > >> self.errno = errno > >> self.description = description > >> > >> def __repr__(self): > >> return "[Error %s], %s" % (self.errno, > >> self.description) > >> > >> def __str__(self): > >> return self.__repr__() > >> > >> class AuthenticationException(Exception): > >> def __init__(self, errno, description): > >> self.errno = errno > >> self.description = description > >> > >> def __repr__(self): > >> return "[Error %s], %s" % (self.errno, > >> self.description) > >> > >> def __str__(self): > >> return self.__repr__() > >> > >> > >> class CommunicationException(Exception): > >> def __init__(self, errno, description): > >> self.errno = errno > >> self.description = description > >> > >> def __repr__(self): > >> return "[Error %s], %s" % (self.errno, > >> self.description) > >> > >> def __str__(self): > >> return self.__repr__() > >> > >> > >> > >> class PHelper: > >> > >> host_keys = {} > >> > >> # credential helper > >> credentials_helper = None > >> > >> ## The credendital helper needs to > >> get_credentials(hostname) method > >> ## to return credentials > >> ## the object returned should: > >> ## get_username() and get_password() > methods > >> ## This would be used when the transport can > not > >> be initialized > >> ## using given methods > >> > >> @classmethod > >> def set_credentials_helper(cls, cred_helper): > >> """ Set the helper class""" > >> cls.credentials_helper = cred_helper > >> > >> > >> @classmethod > >> def load_keys(cls): > >> # TODO : May be we need to load > >> /etc/ssh/known_hosts and merge it here. > >> try: > >> path = > >> os.path.expanduser('~/.ssh/known_hosts') > >> cls.host_keys = > >> paramiko.util.load_host_keys(path) > >> except IOError: > === message truncated === ____________________________________________________________________________________ Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool. http://autos.yahoo.com/carfinder/ From robey at tavi.lag.net Fri Aug 24 11:17:44 2007 From: robey at tavi.lag.net (Robey Pointer) Date: Fri, 24 Aug 2007 11:17:44 -0700 Subject: [paramiko] Problem with authentification In-Reply-To: <54e11fe0707250307m42b7c754m8988e695b0fbcf36@mail.gmail.com> References: <54e11fe0707250307m42b7c754m8988e695b0fbcf36@mail.gmail.com> Message-ID: <7FCF2DB0-729E-4FBB-8618-D57AFE2A722A@tavi.lag.net> On 25 Jul 2007, at 3:07, Mykle wrote: > Hi, I'm french so I apologize for mistakes I'm about to make with > english... > > I installed Paramiko on a Debian Server for making connections with > an SSH Server and here's my issue: > > I create a transport connection with the server for getting files > from it. The server asks an authentification but the public key is > kept by the SSH Server and recognize the computer by his public key > username at computername, the server have a username for the public > key. There's no password anyway ! Until now, I use a bash script > which make an ssh connection with the Server (like 'ssh -x -a > username at sshadress'), but I want to change that for some > verification reasons. I mustn't have to put any key in the code... > What I want is to connect to the Server and that this one accept > this connection by only the recognization of the > username at computername. The documentation doesn't really help me and > I'm not pretty much good in Python (maybe that explains why I'm > writing this mail...*sic*). > > Here's the begining of my code: > > import paramiko > TR = paramiko.Transport((sshAdress,22)) > ... > > ... Yeah I know, it's like there was nothing... > > Thank you for your help. It seems unlikely that you can login with *just* a username, but if you can, the call is: TR.auth_none('my_username') More likely, ssh is using your private key to authenticate. It automatically looks in your ~/.ssh/ folder for a private key and if it finds one, it uses it. You may want to just use SSHClient: client = SSHClient() client.load_system_host_keys() client.connect('hostname', username='my_username') which will look for a private key in the same way that 'ssh' does. Look in the docs for SSHClient for more info. robey From robey at tavi.lag.net Fri Aug 24 11:08:25 2007 From: robey at tavi.lag.net (Robey Pointer) Date: Fri, 24 Aug 2007 11:08:25 -0700 Subject: [paramiko] Testing an exception In-Reply-To: <7c25bb490708080605u1ca27cacg623469be3b75d741@mail.gmail.com> References: <7c25bb490708060713p1a5c38c3o9cad0530eac8351f@mail.gmail.com> <46B8AF40.5030003@activestate.com> <7c25bb490708071044h1cc186cdsc65eb5fccc973dc@mail.gmail.com> <46B91D36.3050501@activestate.com> <7c25bb490708080605u1ca27cacg623469be3b75d741@mail.gmail.com> Message-ID: On 8 Aug 2007, at 6:05, jay wrote: > That makes more sense. The remote SSH server is VEEERY slow and > login times can exceed 1 minute sometimes. Unfortunately, that > server is out of my control. You should be able to extend that timeout by doing: t.banner_timeout = 120 (where 't' is your Transport). 120 would be 120 seconds or two minutes. Now THAT is high latency! :) robey From robey at tavi.lag.net Fri Aug 24 11:21:41 2007 From: robey at tavi.lag.net (Robey Pointer) Date: Fri, 24 Aug 2007 11:21:41 -0700 Subject: [paramiko] Paramiko connection does not react well to sync In-Reply-To: <067C9A1F6AFEB643895EA4513E116884B23A79@exfp1.Railpowertech.local> References: <067C9A1F6AFEB643895EA4513E116884B23A79@exfp1.Railpowertech.local> Message-ID: On 24 Jul 2007, at 8:59, Matthews, James wrote: > Greetings, > > I have been furiously testing a Python (v2.4.3) > application built on wx.Python (v) that uses paramiko (v1.7) for an > SSH connection to essentially a ?bare-bones? Linux box running > dropbear (v0.49). The setup was working great except for one > annoying bug that kept popping up in different locations. Namely, > it appears to happen in very random places during a very long > process in which the application connects to the Linux box, moves a > few files around, updates the image on the box, and then mounts two > particular partitions to restore some files (namely for convenience > so I don?t have to do it manually after the image update). Now the > problem appeared after somebody else went in and added some lines > of code which they thought would make this process more reliable. > I don?t know if this is exactly what was causing the problem, but > after weeks of debugging, tracing, and cursing I found what I > believe the problem to be. Apparently, they had added a function > to open a new session to execute a Linux command on the box, which > just so happened to be the ?sync? command. They had put this in > after every time I mounted a partition in order to access it, and > their comments said something along the lines of, ?#Make sure the > File System is aware?, or ?#Give the File System time before > accessing the file?. It seems that around this command in the > code, the 10 second connection check would sense a downed connection. > > I?m sorry for the length of this email, but basically > my question is? Is it even necessary to perform a ?sync? operation > after just a simple partition mount? And further more, would it > make any sense for this to cause paramiko to close the Transport > unexpectedly? Sorry for the late reply; I've been on vacation. I can't think of a reason why a 'sync' would cause paramiko to disconnect. But I also don't think it's necessary. The 'mount' command should not complete until the filesystem is mounted. Maybe someone else can correct me if I'm wrong. robey From bogus@does.not.exist.com Fri Aug 17 14:01:08 2007 From: bogus@does.not.exist.com () Date: Fri, 17 Aug 2007 21:01:08 -0000 Subject: No subject Message-ID: to execute command on the remote node. ____________________________________________________________________________________ Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow --0-378839011-1190221876=:7593 Content-Type: application/octet-stream; name=paramiko_recv_blocking_dump Content-Transfer-Encoding: base64 Content-Description: 2544352081-paramiko_recv_blocking_dump Content-Disposition: attachment; filename=paramiko_recv_blocking_dump U0lHTkFMIEhBTkRMRVIgClRIUkVBRCAgMAogIEZpbGUgInhlbm1hbi5weSIs IGxpbmUgMzc4NCwgaW4gPG1vZHVsZT4KICAgIGd0ay5tYWluKCkKICBGaWxl ICJ4ZW5tYW4ucHkiLCBsaW5lIDQxLCBpbiBkX3RyYWNlCiAgICB0cmFjZWJh Y2sucHJpbnRfc3RhY2soZikKVEhSRUFEICAxCiAgRmlsZSAiL3Vzci9saWIv cHl0aG9uMi41L3RocmVhZGluZy5weSIsIGxpbmUgNDYwLCBpbiBfX2Jvb3Rz dHJhcAogICAgc2VsZi5ydW4oKQogIEZpbGUgIi9tbnQvaG9tZS9qZC9wcm9q ZWN0L3plbm1hbi9kaWFsb2dzLnB5IiwgbGluZSAxMjUwLCBpbiBydW4KICAg IHNlbGYucmVzdWx0ID0gc2VsZi51aV9jYWxsYmFjaygpCiAgRmlsZSAieGVu bWFuLnB5IiwgbGluZSAzNzIsIGluIDxsYW1iZGE+CiAgICBwYXRoLCBwYXRo KSwKICBGaWxlICJ4ZW5tYW4ucHkiLCBsaW5lIDQ1NiwgaW4gX3JlZnJlc2hf ZG9tcw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