From manpreetsk at gmail.com Mon Mar 5 07:45:02 2007 From: manpreetsk at gmail.com (Manpreet Singh Khurana) Date: Mon, 5 Mar 2007 21:15:02 +0530 Subject: [paramiko] Using paramiko.SFTPclient.get Message-ID: Hi, I have a script written in python which function's as follows 1 establishes a ssh connection using paramiko. 2. establishes a SFTP transport for getting data from remote host using paramiko. 3. Get the list of the file from remote host which needs to be SFTPped 4 now fetch all the files by using the "get "command The problem is that the script runs fine for some arbiratary time (sometimes 30, 40 mins or 4hrs or more) and doing all the steps given above but suddenly it stops without any clues. I have exceptins at each point in my code but none of them are hit. Is the usage of "get" function a problem or a machine problem. Can somebody suggest any solutions. I have paramiko 1.5.3 and running on Solaris 9 sun netra 210. Python release used is 2.4 I have another solaris9 sun4u sparc SUNW,UltraAX-i2 and this script runs fine without any problem on it for any number os hours or days. Manpreet From jdsw2002 at yahoo.com Mon Mar 5 16:08:44 2007 From: jdsw2002 at yahoo.com (jd) Date: Mon, 5 Mar 2007 16:08:44 -0800 (PST) Subject: [paramiko] direct-tcpip Message-ID: <426628.40219.qm@web35805.mail.mud.yahoo.com> Hi One of hte XenMan/ConVirt user is running in to the following. XenMan uses paramiko to connect to the remote machine for executing remote commands as well as for ssh tunneling. Is there a sshd option on server side or client side to disable/enable 'direct-tcpip' tunneling option ? thanks in advance. /Jd debug1: server_input_channel_open: ctype direct-tcpip rchan 1 win 65536 max 34816 debug1: server_request_direct_tcpip: originator localhost port 2000, target localhost port 8005 socket: Address family not supported by protocol connect_to localhost port 8005: failed. debug1: server_input_channel_open: failure direct-tcpip Authentication worked but it appears the port forwarding didn't. 8005 is open on the remote machine's localhost: #nmap -p 8005 localhost Interesting ports on localhost (127.0.0.1): PORT STATE SERVICE 8005/tcp open unknown Full thread available at : https://sourceforge.net/forum/forum.php?thread_id=1640381&forum_id=577781 --------------------------------- Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.lag.net/pipermail/paramiko/attachments/20070305/784f5ba8/attachment.htm From andrew at canonical.com Mon Mar 5 18:22:33 2007 From: andrew at canonical.com (Andrew Bennetts) Date: Tue, 06 Mar 2007 02:22:33 -0000 Subject: [paramiko] How to get trunk version of library ? In-Reply-To: References: Message-ID: <20070215003415.GC21393@steerpike.home.puzzling.org> Anton Patrushev wrote: > Hello. > I try to get trunk version of paramiko library and get following error: > D:\Projects\Libraries\paramico>C:\Python24\Scripts\bzr.bat branch http:// > www.lag.net/paramiko/bzr/paramiko/ > bzr: ERROR: Not a branch: http://www.lag.net/paramiko/bzr/paramiko/ > > How to get trunk version ? > Do you plan to do nigthly trunk builds ? There's a mirror of this branch at http://bazaar.launchpad.net/~robey/paramiko/trun Yes, "trun"! Robey, perhaps you ought to rename that? :) [Actually, if Robey fills in the right info in Launchpad, the mirror URL could simply be "https://launchpad.net/paramiko".] Anyway, the paramiko page probably ought to mention this mirror, for the times when the branch on lag.net is inaccessible for some reason. -Andrew. From kadarlakiran at yahoo.com Mon Mar 5 21:53:56 2007 From: kadarlakiran at yahoo.com (kadarla kiran kumar) Date: Mon, 5 Mar 2007 21:53:56 -0800 (PST) Subject: [paramiko] Implementation of SFTP (secure FTP) Message-ID: <605537.33665.qm@web38812.mail.mud.yahoo.com> Hi all, Iam new to python. From google , I found that paramiko package supports SSh and SFTP kind of stuff. I have installed Python2.5, paramiko 1.6, pcrypto 2.0.1 packages on my windows XP machine.I found some demo scripts along with paramiko package. Iam running demo_simple(as client) and demo_server (as server) on the same system. If anybody has implemented this earlier please guide me. If you dont think Iam overambitious, if possible ,please send me those python scripts. The log of errors , when I run demo_simple: ============================== Hostname: 10.220.10.15:22 hostnmae: 10.220.10.15 port: 22 Username [KiranKumar_Kadarla]: aditya Warning: Problem with getpass. Passwords may be echoed. Password for aditya at 10.220.10.15: hi at 12345 *** Unable to open host keys file hostname:10.220.10.15 port:22 *** Caught exception: : Authentication failed. Traceback (most recent call last): File "C:\paramiko-1.6\paramiko-1.6\demos\demo_simple.py", line 85, in t.connect(username=username, password=password, hostkey=hostkey) File "C:\Python25\Lib\site-packages\paramiko\transport.py", line 851, in connect self.auth_password(username, password) File "C:\Python25\Lib\site-packages\paramiko\transport.py", line 1012, in auth_password return self.auth_handler.wait_for_response(my_event) File "C:\Python25\Lib\site-packages\paramiko\auth_handler.py", line 174, in wait_for_response raise e AuthenticationException: Authentication failed. Traceback (most recent call last): File "C:\paramiko-1.6\paramiko-1.6\demos\demo_simple.py", line 102, in sys.exit(1) SystemExit: 1 THANKS IN ADVANCE K. KIRAN KUMAR Infosys Technologies Limited. --------------------------------- Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.lag.net/pipermail/paramiko/attachments/20070305/32d9225e/attachment.htm From andrew at canonical.com Mon Mar 5 22:52:34 2007 From: andrew at canonical.com (Andrew Bennetts) Date: Tue, 6 Mar 2007 17:52:34 +1100 Subject: [paramiko] Implementation of SFTP (secure FTP) In-Reply-To: <605537.33665.qm@web38812.mail.mud.yahoo.com> References: <605537.33665.qm@web38812.mail.mud.yahoo.com> Message-ID: <20070306065234.GF14306@steerpike.home.puzzling.org> kadarla kiran kumar wrote: [...] > I have installed Python2.5, paramiko 1.6, pcrypto 2.0.1 packages on my windows > XP machine.I found some demo scripts along with paramiko package. Iam running > demo_simple(as client) and demo_server (as server) on the same system. > > If anybody has implemented this earlier please guide me. If you dont think Iam > overambitious, if possible ,please send me those python scripts. > > The log of errors , when I run demo_simple: > ============================== > Hostname: 10.220.10.15:22 > hostnmae: 10.220.10.15 port: 22 > Username [KiranKumar_Kadarla]: aditya > Warning: Problem with getpass. Passwords may be echoed. > Password for aditya at 10.220.10.15: hi at 12345 > *** Unable to open host keys file > hostname:10.220.10.15 port:22 > *** Caught exception: : > Authentication failed. If you are running an unmodified demo_server, then it doesn't use your system username/password authentication, it just has "robey" and "foo" hard-coded: def check_auth_password(self, username, password): if (username == 'robey') and (password == 'foo'): return paramiko.AUTH_SUCCESSFUL return paramiko.AUTH_FAILED So, if you want to log in to the demo server, you need to use a username of "robey" and a password of "foo" (or do publickey authentication with the demos/user_rsa_key key). -Andrew. From Pierre.Dony at nbb.be Thu Mar 8 23:45:15 2007 From: Pierre.Dony at nbb.be (Dony Pierre) Date: Fri, 9 Mar 2007 08:45:15 +0100 Subject: [paramiko] (no subject) Message-ID: <96DBEA7143ECD048905FAAA27D86E0D205BDA6BC@VSRBEX10.LANPRD.NBB> Hi all, I use SSHClient to execute a command on a SAN switch : client = SSHClient() client.load_system_host_keys() client.connect(hostname,username=username,password=password) stdin, stdout, stderr = client.exec_command(cmd) The switch doesn't accept an authentication by key so it closes the connection directly in case of a try with authentication by key. I have to use directly an authentication by password. In the Linux ssh command, the option -o PrefferedAuthentications=password let you change the default option for authentications and force the first try to password. How can I do the same with SSHClient. In the doc, I see for SSHClient : Authentication is attempted in the following order of priority: The pkey or key_filename passed in (if any) Any key we can find through an SSH agent Any "id_rsa" or "id_dsa" key discoverable in ~/.ssh/ Plain username/password auth, if a password was given How can I put "Plain username/password auth, if a password was given" to the first try ? Thanks a lot for your help. Regards. Pierre. ----------------------------------------- Visit our website! http://www.nbb.be "DISCLAIMER: The content of this e-mail message should not be construed as binding on the part of the National Bank of Belgium (NBB) unless otherwise and previously stated. The opinions expressed in this message are solely those of the author and do not necessarily reflect NBB viewpoints, particularly when the content of this message, or part thereof, is private by nature or does not fall within the professional scope of its author." From Pierre.Dony at nbb.be Fri Mar 9 06:56:29 2007 From: Pierre.Dony at nbb.be (Dony Pierre) Date: Fri, 9 Mar 2007 15:56:29 +0100 Subject: [paramiko] (no subject) Message-ID: <96DBEA7143ECD048905FAAA27D86E0D205BDA6C2@VSRBEX10.LANPRD.NBB> Hi all, I'm new python and in paramiko, so can you please help me with this problem = Here is my code (with cmd = "ls") <<<< paramiko.util.log_to_file('ssh-cmd.log') client = paramiko.Transport((hostname,hostport)) client.connect(username=username,password=password) channel=client.open_session() if not channel.exec_command(cmd): raise 'Error:Failed to run command', cmd stdout = channel.makefile('rb') for line in stdout: print line.strip('\n') <<<<< gives the following error : Traceback (most recent call last): File "check_brocade1.py", line 32, in ? raise 'Error:Failed to run command', cmd Error:Failed to run command: ls Output ssh-cmd.log is : DEB [20070123-08:26:28.698] thr=1 paramiko.transport: starting thread (client mode): 0xB7C582ECL INF [20070123-08:26:28.706] thr=1 paramiko.transport: Connected (version 2.0, client OpenSSH_3.9p1) DEB [20070123-08:26:28.712] thr=1 paramiko.transport: kex algos:['diffie-hellman-group-exchange-sha1', 'diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1'] server key:['ssh-rsa', 'ssh-dss'] client encrypt:['aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'arcfour', 'aes192-cbc', 'aes256-cbc', 'rijndael-cbc at lysator.liu.se', 'aes128-ctr', 'aes192-ctr', 'aes256-ctr'] server encrypt:['aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'arcfour', 'aes192-cbc', 'aes256-cbc', 'rijndael-cbc at lysator.liu.se', 'aes128-ctr', 'aes192-ctr', 'aes256-ctr'] client mac:['hmac-md5', 'hmac-sha1', 'hmac-ripemd160', 'hmac-ripemd160 at openssh.com', 'hmac-sha1-96', 'hmac-md5-96'] server mac:['hmac-md5', 'hmac-sha1', 'hmac-ripemd160', 'hmac-ripemd160 at openssh.com', 'hmac-sha1-96', 'hmac-md5-96'] client compress:['none', 'zlib'] server compress:['none', 'zlib'] client lang:[''] server lang:[''] kex follows?False DEB [20070123-08:26:28.712] thr=1 paramiko.transport: Ciphers agreed: local=aes128-cbc, remote=aes128-cbc DEB [20070123-08:26:28.713] thr=1 paramiko.transport: using kex diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local aes128-cbc, remote aes128-cbc; mac: local hmac-sha1, remote hmac-sha1; compression: local none, remote none DEB [20070123-08:26:28.930] thr=1 paramiko.transport: Switch to new keys ... DEB [20070123-08:26:28.932] thr=2 paramiko.transport: Attempting password auth... DEB [20070123-08:26:28.956] thr=1 paramiko.transport: userauth is OK INF [20070123-08:26:28.965] thr=1 paramiko.transport: Authentication (password) successful! DEB [20070123-08:26:28.998] thr=2 paramiko.transport.1: Max packet in: 34816 bytes DEB [20070123-08:26:29.004] thr=1 paramiko.transport.1: Max packet out: 32768 bytes INF [20070123-08:26:29.004] thr=1 paramiko.transport: Secsh channel 1 opened. DEB [20070123-08:26:29.016] thr=1 paramiko.transport.1: Sesch channel 1 request ok Thanks for your help. Regards. Pierre. ----------------------------------------- Visit our website! http://www.nbb.be "DISCLAIMER: The content of this e-mail message should not be construed as binding on the part of the National Bank of Belgium (NBB) unless otherwise and previously stated. The opinions expressed in this message are solely those of the author and do not necessarily reflect NBB viewpoints, particularly when the content of this message, or part thereof, is private by nature or does not fall within the professional scope of its author." From kevin at techadept.com Fri Mar 9 08:24:26 2007 From: kevin at techadept.com (Kevin Horn) Date: Fri, 09 Mar 2007 10:24:26 -0600 Subject: [paramiko] (no subject) In-Reply-To: <96DBEA7143ECD048905FAAA27D86E0D205BDA6C2@VSRBEX10.LANPRD.NBB> References: <96DBEA7143ECD048905FAAA27D86E0D205BDA6C2@VSRBEX10.LANPRD.NBB> Message-ID: <45F18A3A.8000805@techadept.com> If I'm reading the API docs correctly, channel.exec_command does not appear to have a return value, so (IIRC) it will always evaluate to "None" in a boolean expression. Thus your test will always evaluate to true, whether the command runs or not. Someone a little more familiar with paramiko want to either back me up or correct me on this? Kevin Horn Dony Pierre wrote: > Hi all, > > I'm new python and in paramiko, so can you please help me with this > problem = > > Here is my code (with cmd = "ls") > <<<< > paramiko.util.log_to_file('ssh-cmd.log') > client = paramiko.Transport((hostname,hostport)) > client.connect(username=username,password=password) > channel=client.open_session() > > if not channel.exec_command(cmd): > raise 'Error:Failed to run command', cmd > > stdout = channel.makefile('rb') > > for line in stdout: > print line.strip('\n') > <<<<< > gives the following error : > > Traceback (most recent call last): > File "check_brocade1.py", line 32, in ? > raise 'Error:Failed to run command', cmd > Error:Failed to run command: ls > > Output ssh-cmd.log is : > > DEB [20070123-08:26:28.698] thr=1 paramiko.transport: starting thread > (client mode): 0xB7C582ECL > INF [20070123-08:26:28.706] thr=1 paramiko.transport: Connected > (version 2.0, client OpenSSH_3.9p1) > DEB [20070123-08:26:28.712] thr=1 paramiko.transport: kex > algos:['diffie-hellman-group-exchange-sha1', > 'diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1'] server > key:['ssh-rsa', 'ssh-dss'] client encrypt:['aes128-cbc', '3des-cbc', > 'blowfish-cbc', 'cast128-cbc', 'arcfour', 'aes192-cbc', 'aes256-cbc', > 'rijndael-cbc at lysator.liu.se', 'aes128-ctr', 'aes192-ctr', 'aes256-ctr'] > server encrypt:['aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', > 'arcfour', 'aes192-cbc', 'aes256-cbc', 'rijndael-cbc at lysator.liu.se', > 'aes128-ctr', 'aes192-ctr', 'aes256-ctr'] client mac:['hmac-md5', > 'hmac-sha1', 'hmac-ripemd160', 'hmac-ripemd160 at openssh.com', > 'hmac-sha1-96', 'hmac-md5-96'] server mac:['hmac-md5', 'hmac-sha1', > 'hmac-ripemd160', 'hmac-ripemd160 at openssh.com', 'hmac-sha1-96', > 'hmac-md5-96'] client compress:['none', 'zlib'] server compress:['none', > 'zlib'] client lang:[''] server lang:[''] kex follows?False > DEB [20070123-08:26:28.712] thr=1 paramiko.transport: Ciphers agreed: > local=aes128-cbc, remote=aes128-cbc > DEB [20070123-08:26:28.713] thr=1 paramiko.transport: using kex > diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local > aes128-cbc, remote aes128-cbc; mac: local hmac-sha1, remote hmac-sha1; > compression: local none, remote none > DEB [20070123-08:26:28.930] thr=1 paramiko.transport: Switch to new > keys ... > DEB [20070123-08:26:28.932] thr=2 paramiko.transport: Attempting > password auth... > DEB [20070123-08:26:28.956] thr=1 paramiko.transport: userauth is OK > INF [20070123-08:26:28.965] thr=1 paramiko.transport: Authentication > (password) successful! > DEB [20070123-08:26:28.998] thr=2 paramiko.transport.1: Max packet in: > 34816 bytes > DEB [20070123-08:26:29.004] thr=1 paramiko.transport.1: Max packet > out: 32768 bytes > INF [20070123-08:26:29.004] thr=1 paramiko.transport: Secsh channel 1 > opened. > DEB [20070123-08:26:29.016] thr=1 paramiko.transport.1: Sesch channel > 1 request ok > > > Thanks for your help. > Regards. > Pierre. > > > > > ----------------------------------------- > Visit our website! http://www.nbb.be > > "DISCLAIMER: The content of this e-mail message should not be > construed as binding on the part of the National Bank of Belgium > (NBB) unless otherwise and previously stated. The opinions > expressed in this message are solely those of the author and do not > necessarily reflect NBB viewpoints, particularly when the content > of this message, or part thereof, is private by nature or does not > fall within the professional scope of its author." > > > _______________________________________________ > paramiko mailing list > paramiko at lag.net > http://mail.lag.net/mailman/listinfo/paramiko From bialix at ukr.net Sat Mar 10 11:59:48 2007 From: bialix at ukr.net (Alexander Belchenko) Date: Sat, 10 Mar 2007 21:59:48 +0200 Subject: [paramiko] [Paramiko] win_pageant.py: change code to use ctypes instead of pywin32 Message-ID: <45F30E34.1090500@ukr.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Paramiko library allows us to use pageant on Windows. Pageant is brilliant thing for me, but I don't like how paramiko working with pageant. To talk with pageant paramiko used pywin32 library, but only part of big cool pywin32: win32ui module, that provide interface to MFC classes. Actually paramiko use only 2 functions from win32ui, and when packing win32ui to standalone bzr.exe we increase size of standalone application by 650KBytes, and this module also require additional library MFC71.dll with size about 1MBytes. Bad side effect: this dll is not present by default on many popular Windows system and I don't pack it to standalone installer. Another bad side effect: known trusted place to download this library (from Mark Hammond home page at starship.python.net) is now unavailable. Also there is recent security report from Microsoft that affect this library also. Long story short: I finally change internals of paramiko to use ctypes instead of pywin32. ctypes is the part of standard library since Python 2.5, it has very small size (~80KB) and we use it anyway in bzr.exe. I test it myself, and it work for me. Bundle attached. bzr branch http://bazaar.launchpad.net/~bialix/paramiko/paramiko.ctypes I will pack my version in next release of bzr. [?] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF8w40zYr338mxwCURAteUAJ0T+bZt+fEPwtCfJmDkVYnNRJCucgCgiIEK 6eVk8jZvvgbGsSov5X1Jv/c= =b5Lc -----END PGP SIGNATURE----- -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: paramiko.ctypes.patch Url: http://mail.lag.net/pipermail/paramiko/attachments/20070310/609d0ee7/attachment.txt From manpreetsk at gmail.com Mon Mar 12 00:29:11 2007 From: manpreetsk at gmail.com (Manpreet Singh Khurana) Date: Mon, 12 Mar 2007 12:59:11 +0530 Subject: [paramiko] How to catch system errors in python Message-ID: Hi, I am using paramiko 1.5.3 with python 2.4 and pycrypto 1.9 I need to know if it is possible to catch sysytem level error, like "disk space full" or "cpu usage indication" etc. Any help would be appriciated. Regards, MSK From robey at lag.net Mon Mar 12 10:56:26 2007 From: robey at lag.net (Robey Pointer) Date: Mon, 12 Mar 2007 10:56:26 -0700 Subject: [paramiko] (no subject) In-Reply-To: <45F18A3A.8000805@techadept.com> References: <96DBEA7143ECD048905FAAA27D86E0D205BDA6C2@VSRBEX10.LANPRD.NBB> <45F18A3A.8000805@techadept.com> Message-ID: <248F7C06-310C-4EC1-943D-E98F5BEE6A53@lag.net> On 9 Mar 2007, at 8:24, Kevin Horn wrote: > If I'm reading the API docs correctly, channel.exec_command does not > appear to have a return value, so (IIRC) it will always evaluate to > "None" in a boolean expression. > > Thus your test will always evaluate to true, whether the command > runs or > not. > > Someone a little more familiar with paramiko want to either back me up > or correct me on this? That's correct. exec_command() doesn't have a return value. On failure, it will raise an SSHException. robey > Dony Pierre wrote: >> Hi all, >> >> I'm new python and in paramiko, so can you please help me with this >> problem = >> >> Here is my code (with cmd = "ls") >> <<<< >> paramiko.util.log_to_file('ssh-cmd.log') >> client = paramiko.Transport((hostname,hostport)) >> client.connect(username=username,password=password) >> channel=client.open_session() >> >> if not channel.exec_command(cmd): >> raise 'Error:Failed to run command', cmd >> >> stdout = channel.makefile('rb') >> >> for line in stdout: >> print line.strip('\n') >> <<<<< >> gives the following error : >> >> Traceback (most recent call last): >> File "check_brocade1.py", line 32, in ? >> raise 'Error:Failed to run command', cmd >> Error:Failed to run command: ls >> >> Output ssh-cmd.log is : >> >> DEB [20070123-08:26:28.698] thr=1 paramiko.transport: starting >> thread >> (client mode): 0xB7C582ECL >> INF [20070123-08:26:28.706] thr=1 paramiko.transport: Connected >> (version 2.0, client OpenSSH_3.9p1) >> DEB [20070123-08:26:28.712] thr=1 paramiko.transport: kex >> algos:['diffie-hellman-group-exchange-sha1', >> 'diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1'] server >> key:['ssh-rsa', 'ssh-dss'] client encrypt:['aes128-cbc', '3des-cbc', >> 'blowfish-cbc', 'cast128-cbc', 'arcfour', 'aes192-cbc', 'aes256-cbc', >> 'rijndael-cbc at lysator.liu.se', 'aes128-ctr', 'aes192-ctr', 'aes256- >> ctr'] >> server encrypt:['aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128- >> cbc', >> 'arcfour', 'aes192-cbc', 'aes256-cbc', 'rijndael-cbc at lysator.liu.se', >> 'aes128-ctr', 'aes192-ctr', 'aes256-ctr'] client mac:['hmac-md5', >> 'hmac-sha1', 'hmac-ripemd160', 'hmac-ripemd160 at openssh.com', >> 'hmac-sha1-96', 'hmac-md5-96'] server mac:['hmac-md5', 'hmac-sha1', >> 'hmac-ripemd160', 'hmac-ripemd160 at openssh.com', 'hmac-sha1-96', >> 'hmac-md5-96'] client compress:['none', 'zlib'] server compress: >> ['none', >> 'zlib'] client lang:[''] server lang:[''] kex follows?False >> DEB [20070123-08:26:28.712] thr=1 paramiko.transport: Ciphers >> agreed: >> local=aes128-cbc, remote=aes128-cbc >> DEB [20070123-08:26:28.713] thr=1 paramiko.transport: using kex >> diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local >> aes128-cbc, remote aes128-cbc; mac: local hmac-sha1, remote hmac- >> sha1; >> compression: local none, remote none >> DEB [20070123-08:26:28.930] thr=1 paramiko.transport: Switch to new >> keys ... >> DEB [20070123-08:26:28.932] thr=2 paramiko.transport: Attempting >> password auth... >> DEB [20070123-08:26:28.956] thr=1 paramiko.transport: userauth >> is OK >> INF [20070123-08:26:28.965] thr=1 paramiko.transport: >> Authentication >> (password) successful! >> DEB [20070123-08:26:28.998] thr=2 paramiko.transport.1: Max >> packet in: >> 34816 bytes >> DEB [20070123-08:26:29.004] thr=1 paramiko.transport.1: Max packet >> out: 32768 bytes >> INF [20070123-08:26:29.004] thr=1 paramiko.transport: Secsh >> channel 1 >> opened. >> DEB [20070123-08:26:29.016] thr=1 paramiko.transport.1: Sesch >> channel >> 1 request ok >> >> >> Thanks for your help. >> Regards. >> Pierre. >> >> >> >> >> ----------------------------------------- >> Visit our website! http://www.nbb.be >> >> "DISCLAIMER: The content of this e-mail message should not be >> construed as binding on the part of the National Bank of Belgium >> (NBB) unless otherwise and previously stated. The opinions >> expressed in this message are solely those of the author and do not >> necessarily reflect NBB viewpoints, particularly when the content >> of this message, or part thereof, is private by nature or does not >> fall within the professional scope of its author." >> >> >> _______________________________________________ >> 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 robey at lag.net Mon Mar 12 11:06:58 2007 From: robey at lag.net (Robey Pointer) Date: Mon, 12 Mar 2007 11:06:58 -0700 Subject: [paramiko] paramiko API changes in 1.6 Message-ID: <385D0434-4456-47A9-97FA-DA56FF621C6E@lag.net> Since I got another bug report off-list about this, I decided this is probably worth highlighting: In 1.6, a lot of the Channel methods changed from returning a True/ False success indicator to returning nothing, and raising an SSHException on failure. The reason is that I chose poorly the first time around, and returning a True/False success value isn't great design. The channel operations should succeed most of the time, and when they don't, that's exceptional -- so it should raise an exception! :) If you had code (using paramiko 1.4 or 1.5.x) like this: if not chan.exec_command(...): raise Exception(...) You can just change it to: chan.exec_command(...) and an SSHException will be raised if the call fails. The same is true for the other methods on Channel. robey From robey at lag.net Mon Mar 12 11:13:54 2007 From: robey at lag.net (Robey Pointer) Date: Mon, 12 Mar 2007 11:13:54 -0700 Subject: [paramiko] (no subject) In-Reply-To: <96DBEA7143ECD048905FAAA27D86E0D205BDA6BC@VSRBEX10.LANPRD.NBB> References: <96DBEA7143ECD048905FAAA27D86E0D205BDA6BC@VSRBEX10.LANPRD.NBB> Message-ID: On 8 Mar 2007, at 23:45, Dony Pierre wrote: > Hi all, > > I use SSHClient to execute a command on a SAN switch : > > > client = SSHClient() > client.load_system_host_keys() > client.connect(hostname,username=username,password=password) > stdin, stdout, stderr = client.exec_command(cmd) > > The switch doesn't accept an authentication by key so it closes the > connection directly in case of a try with authentication by key. I > have > to use directly an authentication by password. In the Linux ssh > command, > the option -o PrefferedAuthentications=password let you change the > default option for authentications and force the first try to > password. > > How can I do the same with SSHClient. In the doc, I see for > SSHClient : > > Authentication is attempted in the following order of priority: > > The pkey or key_filename passed in (if any) > Any key we can find through an SSH agent > Any "id_rsa" or "id_dsa" key discoverable in ~/.ssh/ > Plain username/password auth, if a password was given > > > How can I put "Plain username/password auth, if a password was > given" to > the first try ? SSHClient doesn't have a way to do that right now. Since a lot of the code in SSHClient is devoted to doing those authentication steps, you'd probably do just as well using Transport directly. Having flags to turn off the private key & agent discovery would be a worthwhile patch. robey From Pierre.Dony at nbb.be Tue Mar 13 01:22:17 2007 From: Pierre.Dony at nbb.be (Dony Pierre) Date: Tue, 13 Mar 2007 09:22:17 +0100 Subject: [paramiko] paramiko API changes in 1.6 In-Reply-To: <385D0434-4456-47A9-97FA-DA56FF621C6E@lag.net> References: <385D0434-4456-47A9-97FA-DA56FF621C6E@lag.net> Message-ID: <96DBEA7143ECD048905FAAA27D86E0D205BDA6C8@VSRBEX10.LANPRD.NBB> Robey, Thanks a lot for your help. It works now fine. paramiko.util.log_to_file('ssh-cmd.log') client = paramiko.Transport((hostname,hostport)) client.connect(username=username,password=password) chan=client.open_session() chan.exec_command(cmd) stdout = chan.makefile('rb') for line in stdout: print line.strip('\n') client.close() Pierre. -----Original Message----- From: paramiko-bounces at lag.net [mailto:paramiko-bounces at lag.net] On Behalf Of Robey Pointer Sent: lundi 12 mars 2007 19:07 To: paramiko Subject: [paramiko] paramiko API changes in 1.6 Since I got another bug report off-list about this, I decided this is probably worth highlighting: In 1.6, a lot of the Channel methods changed from returning a True/ False success indicator to returning nothing, and raising an SSHException on failure. The reason is that I chose poorly the first time around, and returning a True/False success value isn't great design. The channel operations should succeed most of the time, and when they don't, that's exceptional -- so it should raise an exception! :) If you had code (using paramiko 1.4 or 1.5.x) like this: if not chan.exec_command(...): raise Exception(...) You can just change it to: chan.exec_command(...) and an SSHException will be raised if the call fails. The same is true for the other methods on Channel. robey _______________________________________________ paramiko mailing list paramiko at lag.net http://mail.lag.net/mailman/listinfo/paramiko ----------------------------------------- Visit our website! http://www.nbb.be "DISCLAIMER: The content of this e-mail message should not be construed as binding on the part of the National Bank of Belgium (NBB) unless otherwise and previously stated. The opinions expressed in this message are solely those of the author and do not necessarily reflect NBB viewpoints, particularly when the content of this message, or part thereof, is private by nature or does not fall within the professional scope of its author." From mvanderkolff at gmail.com Tue Mar 13 20:05:40 2007 From: mvanderkolff at gmail.com (Michael van der Kolff) Date: Wed, 14 Mar 2007 14:05:40 +1100 Subject: [paramiko] Adding support for the "with" statement Message-ID: <8233f01e0703132005i7e1e7b5dj1f4a81c953fd6f69@mail.gmail.com> I feel that adding support for the with statement could be somewhat useful. I just quickly wrote some support for the 2 classes that I used in my project, but I'm certain a similar pattern could be replicated across the board. Any stylistic comments are, of course, welcome. Cheers, Michael === modified file 'paramiko/client.py' --- paramiko/client.py 2007-02-11 02:26:13 +0000 +++ paramiko/client.py 2007-03-14 02:59:39 +0000 @@ -409,3 +409,6 @@ def _log(self, level, msg): self._transport._log(level, msg) + #Support for "with" statement + __enter__ = (lambda self: self) + __exit__ = (lambda self, *args: self._transport and self.close()) === modified file 'paramiko/sftp_client.py' --- paramiko/sftp_client.py 2006-09-11 17:56:04 +0000 +++ paramiko/sftp_client.py 2007-03-14 02:57:30 +0000 @@ -663,6 +663,9 @@ if self._cwd == '/': return self._cwd + path return self._cwd + '/' + path + #Support for the "with" statement + __enter__ = (lambda self: self) + __exit__ = (lambda self, *args: self.sock and self.close()) class SFTP (SFTPClient): From manpreetsk at gmail.com Thu Mar 15 09:50:00 2007 From: manpreetsk at gmail.com (Manpreet Singh Khurana) Date: Thu, 15 Mar 2007 22:20:00 +0530 Subject: [paramiko] How to use settimeout with from_transport Message-ID: Hi I have a simple utility which opens SSH connection to remote server by using t = paramiko.Transport((hostname, port)) and then doing connect by t.connect(username=username, password=password, hostkey=hostkey) The i am using SFTPClient to open an sftp session across an open ssh Transport and do remote file operations. sftp = paramiko.SFTPClient.from_transport(t) Now with this SFTP Client object i am opening a file on the remote server rPath= sftp.file(fileName, 'rb') and reading the file from this path data = rPath.read(32768) Now I want to use the settimeout API to set the timeout value of this socket so that id the read operation takes time more than the configured value we should be able to timeout that socket How can this be done Can i use sftp.settimeout(60) directly Do we have a sample code to understand the usage Can somebody tell me how this is done. This is urgent, please help. MSK From jbardin at bu.edu Thu Mar 15 14:13:58 2007 From: jbardin at bu.edu (James Bardin) Date: Thu, 15 Mar 2007 17:13:58 -0400 Subject: [paramiko] How to use settimeout with from_transport In-Reply-To: References: Message-ID: <45F9B716.60709@bu.edu> I've wondered how to do this myself, and I have a method that works, but maybe someone will let us know if there's a better way. My program uses a large number of connections simultaneously, so to set a short timeout for everything I do the following: from socket import setdefaulttimeout setdefaulttimeout(2) This setting propagates up and is used by the sockets created by paramiko. If it makes a difference, I'm building my connection with: client = SSHClient() client.connect(...) sftp = client.open_sftp() -jim Manpreet Singh Khurana wrote: > Hi > I have a simple utility which opens SSH connection to remote server by using > > t = paramiko.Transport((hostname, port)) > and then doing connect by > > t.connect(username=username, password=password, hostkey=hostkey) > > The i am using SFTPClient to open an sftp session across an open ssh > Transport and do remote file operations. > sftp = paramiko.SFTPClient.from_transport(t) > > Now with this SFTP Client object i am opening a file on the remote server > rPath= sftp.file(fileName, 'rb') > and reading the file from this path > data = rPath.read(32768) > > Now I want to use the settimeout API to set the timeout value of this > socket so that id the read operation takes time more than the > configured value we should be > able to timeout that socket > > How can this be done > Can i use sftp.settimeout(60) directly > Do we have a sample code to understand the usage > Can somebody tell me how this is done. > This is urgent, please help. > > MSK > > _______________________________________________ > paramiko mailing list > paramiko at lag.net > http://mail.lag.net/mailman/listinfo/paramiko > > From toddw at activestate.com Thu Mar 15 19:18:22 2007 From: toddw at activestate.com (Todd Whiteman) Date: Thu, 15 Mar 2007 19:18:22 -0700 Subject: [paramiko] How to use settimeout with from_transport In-Reply-To: <45F9B716.60709@bu.edu> References: <45F9B716.60709@bu.edu> Message-ID: <45F9FE6E.8070808@activestate.com> James Bardin wrote: > I've wondered how to do this myself, and I have a method that works, but > maybe someone will let us know if there's a better way. > > My program uses a large number of connections simultaneously, so to set > a short timeout for everything I do the following: > > from socket import setdefaulttimeout > setdefaulttimeout(2) > Ouch, thats global settings for socket timeout. I used the following, which seems to work on a per socket basis, though it still seems a little hacky to me: # After I establish the SSH transport connection sftp = paramiko.SFTP.from_transport(connection) # sftp.sock in this case is actually a paramiko.Channel object sftp.sock.settimeout(self._socket_timeout) Robey can probably offer a better sol'n :) Cheers, Todd > This setting propagates up and is used by the sockets created by paramiko. > > > If it makes a difference, I'm building my connection with: > client = SSHClient() > client.connect(...) > sftp = client.open_sftp() > > -jim > > > > Manpreet Singh Khurana wrote: >> Hi >> I have a simple utility which opens SSH connection to remote server by using >> >> t = paramiko.Transport((hostname, port)) >> and then doing connect by >> >> t.connect(username=username, password=password, hostkey=hostkey) >> >> The i am using SFTPClient to open an sftp session across an open ssh >> Transport and do remote file operations. >> sftp = paramiko.SFTPClient.from_transport(t) >> >> Now with this SFTP Client object i am opening a file on the remote server >> rPath= sftp.file(fileName, 'rb') >> and reading the file from this path >> data = rPath.read(32768) >> >> Now I want to use the settimeout API to set the timeout value of this >> socket so that id the read operation takes time more than the >> configured value we should be >> able to timeout that socket >> >> How can this be done >> Can i use sftp.settimeout(60) directly >> Do we have a sample code to understand the usage >> Can somebody tell me how this is done. >> This is urgent, please help. >> >> MSK From jbardin at bu.edu Fri Mar 16 06:54:07 2007 From: jbardin at bu.edu (James Bardin) Date: Fri, 16 Mar 2007 09:54:07 -0400 Subject: [paramiko] How to use settimeout with from_transport In-Reply-To: <45F9FE6E.8070808@activestate.com> References: <45F9B716.60709@bu.edu> <45F9FE6E.8070808@activestate.com> Message-ID: <45FAA17F.8060006@bu.edu> Todd Whiteman wrote: > James Bardin wrote: >> I've wondered how to do this myself, and I have a method that works, >> but maybe someone will let us know if there's a better way. >> >> My program uses a large number of connections simultaneously, so to >> set a short timeout for everything I do the following: >> >> from socket import setdefaulttimeout >> setdefaulttimeout(2) >> > > Ouch, thats global settings for socket timeout. > Yeah, it was a quick fix, but a global setting actually works in this case. I didn't see sftp.sock, because it doesn't show up until you build the object. Even when I go back and look at the docs now, I don't see where you would find how to access the socket settings in a connection. I still need to set timeouts for the SSHClient() though, and it look wrong to use client = SSHClient() client._transport.sock.settimeout() when he's implying that _transport is private. -jim > I used the following, which seems to work on a per socket basis, > though it still seems a little hacky to me: > > # After I establish the SSH transport connection > sftp = paramiko.SFTP.from_transport(connection) > # sftp.sock in this case is actually a paramiko.Channel object > sftp.sock.settimeout(self._socket_timeout) > > > Robey can probably offer a better sol'n :) > > Cheers, > Todd > > From kadarlakiran at yahoo.com Wed Mar 21 22:23:39 2007 From: kadarlakiran at yahoo.com (kadarla kiran kumar) Date: Wed, 21 Mar 2007 22:23:39 -0700 (PDT) Subject: [paramiko] copying only recent files from one machine to another. Message-ID: <577955.26188.qm@web38813.mail.mud.yahoo.com> Hi Everybody, Iam trying to copy files from one machine to another over SFTP connection. For that Iam using sftp.get & sftp.put methods. Now, I have to copy only recently created/modified files,i.e, based on timestamps from remote machine to my machine. Is there any standard implementation for that in python/paramiko ? If not , can anyone suggest me the efficient method to implement the same. Thanks in Advance, Kiran Kumar --------------------------------- Get your own web address. Have a HUGE year through Yahoo! Small Business. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.lag.net/pipermail/paramiko/attachments/20070321/2ed3c5d2/attachment.htm From manpreetsk at gmail.com Thu Mar 22 04:12:35 2007 From: manpreetsk at gmail.com (Manpreet Singh Khurana) Date: Thu, 22 Mar 2007 16:42:35 +0530 Subject: [paramiko] copying only recent files from one machine to another. In-Reply-To: <577955.26188.qm@web38813.mail.mud.yahoo.com> References: <577955.26188.qm@web38813.mail.mud.yahoo.com> Message-ID: First of all let me tell you that get and put function do not throw exceptions. If you read the Paramiko API document it states that the exceptions will be "passed through". I dont think there is a API in python which can do stateful file fetching, though what you can do is that you tokenize your file Tokanize your file with the field separator bu using "split" API and then store the last timestamp in a external file . In the next fetch compare with the stored TS with the new TS and if new TS is less than the stored value skip it else fetch it and update the file with this new TS. Manpreet On 3/22/07, kadarla kiran kumar wrote: > Hi Everybody, > > Iam trying to copy files from one machine to another over SFTP connection. > For that Iam using sftp.get & sftp.put methods. > > Now, I have to copy only recently created/modified files,i.e, based on > timestamps from remote machine to my machine. Is there any standard > implementation for that in python/paramiko ? If not , can anyone suggest me > the efficient method to implement the same. > > Thanks in Advance, > Kiran Kumar > > ________________________________ > Get your own web address. > Have a HUGE year through Yahoo! Small Business. > > > _______________________________________________ > paramiko mailing list > paramiko at lag.net > http://mail.lag.net/mailman/listinfo/paramiko > From jbardin at bu.edu Thu Mar 22 06:48:53 2007 From: jbardin at bu.edu (James Bardin) Date: Thu, 22 Mar 2007 09:48:53 -0400 Subject: [paramiko] copying only recent files from one machine to another. In-Reply-To: References: <577955.26188.qm@web38813.mail.mud.yahoo.com> Message-ID: <46028945.7010301@bu.edu> If you're not looking to create stateful transfers, you could just compare the mtime of the local and remote files. An sftp instance has stat(), and lstat() methods. These return an SFTPAttributes object with properties that can be compared with os.stat() and os.lstat(). -jim Manpreet Singh Khurana wrote: > First of all let me tell you that get and put function do not throw > exceptions. If you read the Paramiko API document it states that the > exceptions will be "passed through". > I dont think there is a API in python which can do stateful file > fetching, though what you can do is that you tokenize your file > > Tokanize your file with the field separator bu using "split" API and > then store the last timestamp in a external file . In the next fetch > compare with the stored TS with the new TS and if new TS is less than > the stored value skip it else fetch it and update the file with this > new TS. > > Manpreet > > On 3/22/07, kadarla kiran kumar wrote: > >> Hi Everybody, >> >> Iam trying to copy files from one machine to another over SFTP connection. >> For that Iam using sftp.get & sftp.put methods. >> >> Now, I have to copy only recently created/modified files,i.e, based on >> timestamps from remote machine to my machine. Is there any standard >> implementation for that in python/paramiko ? If not , can anyone suggest me >> the efficient method to implement the same. >> >> Thanks in Advance, >> Kiran Kumar >> >> ________________________________ >> From manpreetsk at gmail.com Thu Mar 22 08:09:56 2007 From: manpreetsk at gmail.com (Manpreet Singh Khurana) Date: Thu, 22 Mar 2007 20:39:56 +0530 Subject: [paramiko] what is the exception if sftp object dies Message-ID: Hi, I am doing sftp transport connection by doing sftp = paramiko.SFTP.from_transport(tc) on this sftp object i do all the read and write operation for a file. Now if for some reason the SFTP connection is gone and if we are trying to do something like sftp.read() operation, this will fail since there no sftp connection alive In this case what sort of exception is returned? Actually i need to catch this and try SFTP connection again. Manpreet From toddw at activestate.com Thu Mar 22 14:35:14 2007 From: toddw at activestate.com (Todd Whiteman) Date: Thu, 22 Mar 2007 14:35:14 -0700 Subject: [paramiko] what is the exception if sftp object dies In-Reply-To: References: Message-ID: <4602F692.6090608@activestate.com> Not sure what the exact exception is, but it's probably better to check the connection before you perform the sftp.read() using something like: if not connection.is_active(): reconnect() sftp.read() Note: Any error(s) is likely one of: paramiko.SFTPError IOError socket.error Cheers, Todd Manpreet Singh Khurana wrote: > Hi, > I am doing sftp transport connection by doing > > sftp = paramiko.SFTP.from_transport(tc) > > on this sftp object i do all the read and write operation for a file. > > Now if for some reason the SFTP connection is gone and if we are > trying to do something like > sftp.read() operation, this will fail since there no sftp connection alive > > In this case what sort of exception is returned? > > Actually i need to catch this and try SFTP connection again. > > Manpreet > > _______________________________________________ > paramiko mailing list > paramiko at lag.net > http://mail.lag.net/mailman/listinfo/paramiko > From robey at lag.net Mon Mar 26 07:49:33 2007 From: robey at lag.net (Robey Pointer) Date: Mon, 26 Mar 2007 07:49:33 -0700 Subject: [paramiko] How to use settimeout with from_transport In-Reply-To: <45F9FE6E.8070808@activestate.com> References: <45F9B716.60709@bu.edu> <45F9FE6E.8070808@activestate.com> Message-ID: <51EF58F9-0535-4FD0-B120-D8CBB834B835@lag.net> On 15 Mar 2007, at 19:18, Todd Whiteman wrote: > James Bardin wrote: >> I've wondered how to do this myself, and I have a method that >> works, but >> maybe someone will let us know if there's a better way. >> >> My program uses a large number of connections simultaneously, so >> to set >> a short timeout for everything I do the following: >> >> from socket import setdefaulttimeout >> setdefaulttimeout(2) >> > > Ouch, thats global settings for socket timeout. > > I used the following, which seems to work on a per socket basis, > though > it still seems a little hacky to me: > > # After I establish the SSH transport connection > sftp = paramiko.SFTP.from_transport(connection) > # sftp.sock in this case is actually a paramiko.Channel object > sftp.sock.settimeout(self._socket_timeout) > > > Robey can probably offer a better sol'n :) Actually that's the best solution right now. :) I'll add a get_channel() method to SFTPClient, since this has come up before, but it's also fine to access the 'sock' member directly. robey From robey at lag.net Mon Mar 26 07:52:29 2007 From: robey at lag.net (Robey Pointer) Date: Mon, 26 Mar 2007 07:52:29 -0700 Subject: [paramiko] How to use settimeout with from_transport In-Reply-To: <45FAA17F.8060006@bu.edu> References: <45F9B716.60709@bu.edu> <45F9FE6E.8070808@activestate.com> <45FAA17F.8060006@bu.edu> Message-ID: <378933AE-E927-4818-97CF-5B7CB18E623A@lag.net> On 16 Mar 2007, at 6:54, James Bardin wrote: > > > Todd Whiteman wrote: >> James Bardin wrote: >>> I've wondered how to do this myself, and I have a method that works, >>> but maybe someone will let us know if there's a better way. >>> >>> My program uses a large number of connections simultaneously, so to >>> set a short timeout for everything I do the following: >>> >>> from socket import setdefaulttimeout >>> setdefaulttimeout(2) >>> >> >> Ouch, thats global settings for socket timeout. >> > Yeah, it was a quick fix, but a global setting actually works in > this case. > I didn't see sftp.sock, because it doesn't show up until you build the > object. > Even when I go back and look at the docs now, I don't see where you > would find how to access the socket settings in a connection. > > I still need to set timeouts for the SSHClient() though, and it look > wrong to use > client = SSHClient() > client._transport.sock.settimeout() > when he's implying that _transport is private. Timeouts on the socket object are handled at a different level in paramiko, so it can check for status changes while doing I/O. It looks like the socket timeout is set to 0.1 inside Transport, so I'd be surprised if setting the socket timeout manually to 2 had any effect other than making a few status changes more sluggish. robey From jbardin at bu.edu Mon Mar 26 08:33:58 2007 From: jbardin at bu.edu (James Bardin) Date: Mon, 26 Mar 2007 11:33:58 -0400 Subject: [paramiko] How to use settimeout with from_transport In-Reply-To: <378933AE-E927-4818-97CF-5B7CB18E623A@lag.net> References: <45F9B716.60709@bu.edu> <45F9FE6E.8070808@activestate.com> <45FAA17F.8060006@bu.edu> <378933AE-E927-4818-97CF-5B7CB18E623A@lag.net> Message-ID: <4607E7E6.3040905@bu.edu> Robey Pointer wrote: > > On 16 Mar 2007, at 6:54, James Bardin wrote: > >> >> >> Todd Whiteman wrote: >>> James Bardin wrote: >>>> I've wondered how to do this myself, and I have a method that works, >>>> but maybe someone will let us know if there's a better way. >>>> >>>> My program uses a large number of connections simultaneously, so to >>>> set a short timeout for everything I do the following: >>>> >>>> from socket import setdefaulttimeout >>>> setdefaulttimeout(2) >>>> >>> >>> Ouch, thats global settings for socket timeout. >>> >> Yeah, it was a quick fix, but a global setting actually works in this >> case. >> I didn't see sftp.sock, because it doesn't show up until you build the >> object. >> Even when I go back and look at the docs now, I don't see where you >> would find how to access the socket settings in a connection. >> >> I still need to set timeouts for the SSHClient() though, and it look >> wrong to use >> client = SSHClient() >> client._transport.sock.settimeout() >> when he's implying that _transport is private. > > Timeouts on the socket object are handled at a different level in > paramiko, so it can check for status changes while doing I/O. > > It looks like the socket timeout is set to 0.1 inside Transport, so > I'd be surprised if setting the socket timeout manually to 2 had any > effect other than making a few status changes more sluggish. > > robey > > My case is a little unusual. It's actually before the transport is built where I have problems. I need to connect to a very large number of hosts simultaneously, some of which may or may not be working properly. I want the connection to drop if I can't build a channel within a few seconds. The catch is that sometimes the host is up, but the ssh daemon isn't responding, so I don't get a "No route to host", and we hang. I'm trying to replicate an option like "-o ConnectTimeout=2" from ssh. BTW, I like the SSHClient class. It abstracts exactly what I need (not counting the above). Thanks, -jim