Paramiko bugs out on windows 2003 server
I am using the paramiko library to pull a data from a server using SFTP. It works perfect on a windows xp machine but bugs out a windows 2003 server. I get the following error: Traceback (most recent call last): File S:\Temp\ftpBOA.py, line 5, in ? import paramiko File C:\Python23\lib\paramiko\__init__.py, line 69, in ? from transport import randpool, SecurityOptions, Transport File C:\Python23\lib\paramiko\transport.py, line 32, in ? from paramiko import util File C:\Python23\lib\paramiko\util.py, line 31, in ? from paramiko.common import * File C:\Python23\lib\paramiko\common.py, line 98, in ? from osrandom import OSRandomPool File C:\Python23\lib\paramiko\osrandom.py, line 54, in ? raise ImportError(Cannot find OS entropy source) ImportError: Cannot find OS entropy source Anyone knows how to solve it ? Tarun Kapoor Disclaimer This e-mail and any attachments is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Waterstone Capital Management, L.P and affiliates. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this e-mail in error. You should also be aware that e-mails are susceptible to interference and you should not assume that the contents of this e-mail originated from the sender above or that they have been accurately reproduced in their original form. Waterstone Capital Management, L.P. and affiliates accepts no responsibility for information, or errors or omissions in this e-mail or use or misuse thereof. If in doubt, please verify the authenticity with the! sender. -- http://mail.python.org/mailman/listinfo/python-list
RE: paramiko
I have some code that uses paramiko, establishes an SFTP connection with a remote server and downloads some files. This code works perfect if run on a windows XP machine. However, I get an error in the RandomPool class. Anyone tried paramiko on a windows server box ? Thanks !! Tk -Original Message- From: Guilherme Polo [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 16, 2008 11:12 AM To: Tarun Kapoor; python-list@python.org Subject: Re: paramiko 2008/1/16, Tarun Kapoor [EMAIL PROTECTED]: I am using paramiko to do an SFTP file transfer... I was able to connect to the remote server using an SFTP client I have just to make sure that username and password are working.. This is the code. # now, connect and use paramiko Transport to negotiate SSH2 across the connection sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) t = paramiko.Transport(sock) event = threading.Event() t.start_client(event) event.wait(15) if not t.is_active(): print 'SSH negotiation failed.' sys.exit(1) else: print SSH negotiation sucessful event.clear() t.auth_password(username=username, password=password,event=event) if not t.is_authenticated(): print not authenticated output: SSH negotiation successful not authenticated Tarun Waterstone Capital Management 2 Carlson Parkway, Suite 260 Plymouth, MN 55447 Direct: 952-697-4123 Cell:612-205-2587 Disclaimer This e-mail and any attachments is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Waterstone Capital Management, L.P and affiliates. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this e-mail in error. You should also be aware that e-mails are susceptible to interference and you should not assume that the contents of this e-mail originated from the sender above or that they have been accurately reproduced in their original form. Waterstone Capital Management, L.P. and affiliates accepts no responsibility for information, or errors or omissions in this e-mail or use or misuse thereof. If in doubt, please verify the authenticity with the sender. -- http://mail.python.org/mailman/listinfo/python-list You are missing an event.wait() after t.auth_password. Also, why are you passing this magic value 15 to event.wait() ? That parameter is passed to class _Verbose to indicate if debug messages should be displayed or not, so typical values would be 0/1 or False/True. -- -- Guilherme H. Polo Goncalves Disclaimer This e-mail and any attachments is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Waterstone Capital Management, L.P and affiliates. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this e-mail in error. You should also be aware that e-mails are susceptible to interference and you should not assume that the contents of this e-mail originated from the sender above or that they have been accurately reproduced in their original form. Waterstone Capital Management, L.P. and affiliates accepts no responsibility for information, or errors or omissions in this e-mail or use or misuse thereof. If in doubt, please verify the authenticity with the! sender. -- http://mail.python.org/mailman/listinfo/python-list
Paramiko/SSH blues....
I am using paramiko to do an SFTP file transfer... I was able to connect to the remote server using an SFTP client I have just to make sure that username and password are working.. But when i try to connect using this script it fails **hostname, username and password are declared. # now, connect and use paramiko Transport to negotiate SSH2 across the connection sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) t = paramiko.Transport(sock) event = threading.Event() t.start_client(event) event.wait(15) if not t.is_active(): print 'SSH negotiation failed.' sys.exit(1) else: print SSH negotiation sucessful event.clear() t.auth_password(username=username, password=password,event=event) if not t.is_authenticated(): print not authenticated output: SSH negotiation successful not authenticated -- http://mail.python.org/mailman/listinfo/python-list
paramiko
I am using paramiko to do an SFTP file transfer... I was able to connect to the remote server using an SFTP client I have just to make sure that username and password are working.. This is the code. # now, connect and use paramiko Transport to negotiate SSH2 across the connection sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) t = paramiko.Transport(sock) event = threading.Event() t.start_client(event) event.wait(15) if not t.is_active(): print 'SSH negotiation failed.' sys.exit(1) else: print SSH negotiation sucessful event.clear() t.auth_password(username=username, password=password,event=event) if not t.is_authenticated(): print not authenticated output: SSH negotiation successful not authenticated Tarun Waterstone Capital Management 2 Carlson Parkway, Suite 260 Plymouth, MN 55447 Direct: 952-697-4123 Cell:612-205-2587 Disclaimer This e-mail and any attachments is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Waterstone Capital Management, L.P and affiliates. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this e-mail in error. You should also be aware that e-mails are susceptible to interference and you should not assume that the contents of this e-mail originated from the sender above or that they have been accurately reproduced in their original form. Waterstone Capital Management, L.P. and affiliates accepts no responsibility for information, or errors or omissions in this e-mail or use or misuse thereof. If in doubt, please verify the authenticity with the sender. -- http://mail.python.org/mailman/listinfo/python-list
Re: paramiko
# now, connect and use paramiko Transport to negotiate SSH2 across the connection sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) t = paramiko.Transport(sock) t.start_client() key = t.get_remote_server_key() event = threading.Event() t.auth_password(username=username, password=password, event=event) event.wait() if not t.is_authenticated(): print not authenticated output: not authenticated On Jan 16, 11:11 am, Guilherme Polo [EMAIL PROTECTED] wrote: 2008/1/16, Tarun Kapoor [EMAIL PROTECTED]: I am using paramiko to do an SFTP file transfer... I was able to connect to the remote server using an SFTP client I have just to make sure that username and password are working.. This is the code. # now, connect and use paramiko Transport to negotiate SSH2 across the connection sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) t = paramiko.Transport(sock) event = threading.Event() t.start_client(event) event.wait(15) if not t.is_active(): print 'SSH negotiation failed.' sys.exit(1) else: print SSH negotiation sucessful event.clear() t.auth_password(username=username, password=password,event=event) if not t.is_authenticated(): print not authenticated output: SSH negotiation successful not authenticated Tarun Waterstone Capital Management 2 Carlson Parkway, Suite 260 Plymouth, MN 55447 Direct: 952-697-4123 Cell:612-205-2587 Disclaimer This e-mail and any attachments is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Waterstone Capital Management, L.P and affiliates. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this e-mail in error. You should also be aware that e-mails are susceptible to interference and you should not assume that the contents of this e-mail originated from the sender above or that they have been accurately reproduced in their original form. Waterstone Capital Management, L.P. and affiliates accepts no responsibility for information, or errors or omissions in this e-mail or use or misuse thereof. If in doubt, please verify the authenticity with the sender. -- http://mail.python.org/mailman/listinfo/python-list You are missing an event.wait() after t.auth_password. Also, why are you passing this magic value 15 to event.wait() ? That parameter is passed to class _Verbose to indicate if debug messages should be displayed or not, so typical values would be 0/1 or False/True. -- -- Guilherme H. Polo Goncalves -- http://mail.python.org/mailman/listinfo/python-list
Re: paramiko
On Jan 16, 11:38 am, Guilherme Polo [EMAIL PROTECTED] wrote: 2008/1/16, Tarun Kapoor [EMAIL PROTECTED]: # now, connect and use paramiko Transport to negotiate SSH2 across the connection sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) t = paramiko.Transport(sock) t.start_client() key = t.get_remote_server_key() event = threading.Event() t.auth_password(username=username, password=password, event=event) event.wait() if not t.is_authenticated(): print not authenticated output: not authenticated This is a different problem I guess, now you are usin get_remote_server_key. And why are you creating event after calling start_client without specifying it ? On Jan 16, 11:11 am, Guilherme Polo [EMAIL PROTECTED] wrote: 2008/1/16, Tarun Kapoor [EMAIL PROTECTED]: I am using paramiko to do an SFTP file transfer... I was able to connect to the remote server using an SFTP client I have just to make sure that username and password are working.. This is the code. # now, connect and use paramiko Transport to negotiate SSH2 across the connection sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) t = paramiko.Transport(sock) event = threading.Event() t.start_client(event) event.wait(15) if not t.is_active(): print 'SSH negotiation failed.' sys.exit(1) else: print SSH negotiation sucessful event.clear() t.auth_password(username=username, password=password,event=event) if not t.is_authenticated(): print not authenticated output: SSH negotiation successful not authenticated Tarun Waterstone Capital Management 2 Carlson Parkway, Suite 260 Plymouth, MN 55447 Direct: 952-697-4123 Cell:612-205-2587 Disclaimer This e-mail and any attachments is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Waterstone Capital Management, L.P and affiliates. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this e-mail in error. You should also be aware that e-mails are susceptible to interference and you should not assume that the contents of this e-mail originated from the sender above or that they have been accurately reproduced in their original form. Waterstone Capital Management, L.P. and affiliates accepts no responsibility for information, or errors or omissions in this e-mail or use or misuse thereof. If in doubt, please verify the authenticity with the sender. -- http://mail.python.org/mailman/listinfo/python-list You are missing an event.wait() after t.auth_password. Also, why are you passing this magic value 15 to event.wait() ? That parameter is passed to class _Verbose to indicate if debug messages should be displayed or not, so typical values would be 0/1 or False/True. -- -- Guilherme H. Polo Goncalves -- http://mail.python.org/mailman/listinfo/python-list -- -- Guilherme H. Polo Goncalves ok here is the problem... I don't know what is the correct way... The only demos i have from the paramiko library use a hostkeyfile. since i don't have that i thought i would use the get_remote_key to get the key and then connect it using the code in the demo.. But clearly nothing is working...I should not HAVE to use the key since i should be able to authenticate using the password... Can you please suggest the right way to go ? Thanks for your time ! -- http://mail.python.org/mailman/listinfo/python-list
Re: paramiko
On Jan 16, 12:22 pm, Guilherme Polo [EMAIL PROTECTED] wrote: 2008/1/16, Tarun Kapoor [EMAIL PROTECTED]: On Jan 16, 11:38 am, Guilherme Polo [EMAIL PROTECTED] wrote: 2008/1/16, Tarun Kapoor [EMAIL PROTECTED]: # now, connect and use paramiko Transport to negotiate SSH2 across the connection sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) t = paramiko.Transport(sock) t.start_client() key = t.get_remote_server_key() event = threading.Event() t.auth_password(username=username, password=password, event=event) event.wait() if not t.is_authenticated(): print not authenticated output: not authenticated This is a different problem I guess, now you are usin get_remote_server_key. And why are you creating event after calling start_client without specifying it ? On Jan 16, 11:11 am, Guilherme Polo [EMAIL PROTECTED] wrote: 2008/1/16, Tarun Kapoor [EMAIL PROTECTED]: I am using paramiko to do an SFTP file transfer... I was able to connect to the remote server using an SFTP client I have just to make sure that username and password are working.. This is the code. # now, connect and use paramiko Transport to negotiate SSH2 across the connection sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) t = paramiko.Transport(sock) event = threading.Event() t.start_client(event) event.wait(15) if not t.is_active(): print 'SSH negotiation failed.' sys.exit(1) else: print SSH negotiation sucessful event.clear() t.auth_password(username=username, password=password,event=event) if not t.is_authenticated(): print not authenticated output: SSH negotiation successful not authenticated Tarun Waterstone Capital Management 2 Carlson Parkway, Suite 260 Plymouth, MN 55447 Direct: 952-697-4123 Cell:612-205-2587 Disclaimer This e-mail and any attachments is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Waterstone Capital Management, L.P and affiliates. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this e-mail in error. You should also be aware that e-mails are susceptible to interference and you should not assume that the contents of this e-mail originated from the sender above or that they have been accurately reproduced in their original form. Waterstone Capital Management, L.P. and affiliates accepts no responsibility for information, or errors or omissions in this e-mail or use or misuse thereof. If in doubt, please verify the authenticity with the sender. -- http://mail.python.org/mailman/listinfo/python-list You are missing an event.wait() after t.auth_password. Also, why are you passing this magic value 15 to event.wait() ? That parameter is passed to class _Verbose to indicate if debug messages should be displayed or not, so typical values would be 0/1 or False/True. -- -- Guilherme H. Polo Goncalves -- http://mail.python.org/mailman/listinfo/python-list -- -- Guilherme H. Polo Goncalves ok here is the problem... I don't know what is the correct way... The only demos i have from the paramiko library use a hostkeyfile. since i don't have that i thought i would use the get_remote_key to get the key and then connect it using the code in the demo.. But clearly nothing is working...I should not HAVE to use the key since i should be able to authenticate using the password... Can you please suggest the right way to go ? You don't need to use key to authenticate using username and password, indeed. And you don't. Your first email was almost correct, you just needed to add event.wait() after t.auth_password. It worked here after doing that change. You can check out my version: import sys import socket import paramiko import threading if len(sys.argv) != 4: print %s hostname user password % sys.argv[0] sys.exit(1) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((sys.argv[1], 22)) t = paramiko.Transport(sock) event = threading.Event() t.start_client(event) event.wait() if not t.is_active
Re: paramiko
On Jan 16, 1:56 pm, Guilherme Polo [EMAIL PROTECTED] wrote: 2008/1/16, Tarun Kapoor [EMAIL PROTECTED]: On Jan 16, 12:22 pm, Guilherme Polo [EMAIL PROTECTED] wrote: 2008/1/16, Tarun Kapoor [EMAIL PROTECTED]: On Jan 16, 11:38 am, Guilherme Polo [EMAIL PROTECTED] wrote: 2008/1/16, Tarun Kapoor [EMAIL PROTECTED]: # now, connect and use paramiko Transport to negotiate SSH2 across the connection sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) t = paramiko.Transport(sock) t.start_client() key = t.get_remote_server_key() event = threading.Event() t.auth_password(username=username, password=password, event=event) event.wait() if not t.is_authenticated(): print not authenticated output: not authenticated This is a different problem I guess, now you are usin get_remote_server_key. And why are you creating event after calling start_client without specifying it ? On Jan 16, 11:11 am, Guilherme Polo [EMAIL PROTECTED] wrote: 2008/1/16, Tarun Kapoor [EMAIL PROTECTED]: I am using paramiko to do an SFTP file transfer... I was able to connect to the remote server using an SFTP client I have just to make sure that username and password are working.. This is the code. # now, connect and use paramiko Transport to negotiate SSH2 across the connection sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((hostname, port)) t = paramiko.Transport(sock) event = threading.Event() t.start_client(event) event.wait(15) if not t.is_active(): print 'SSH negotiation failed.' sys.exit(1) else: print SSH negotiation sucessful event.clear() t.auth_password(username=username, password=password,event=event) if not t.is_authenticated(): print not authenticated output: SSH negotiation successful not authenticated Tarun Waterstone Capital Management 2 Carlson Parkway, Suite 260 Plymouth, MN 55447 Direct: 952-697-4123 Cell:612-205-2587 Disclaimer This e-mail and any attachments is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Waterstone Capital Management, L.P and affiliates. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this e-mail in error. You should also be aware that e-mails are susceptible to interference and you should not assume that the contents of this e-mail originated from the sender above or that they have been accurately reproduced in their original form. Waterstone Capital Management, L.P. and affiliates accepts no responsibility for information, or errors or omissions in this e-mail or use or misuse thereof. If in doubt, please verify the authenticity with the sender. -- http://mail.python.org/mailman/listinfo/python-list You are missing an event.wait() after t.auth_password. Also, why are you passing this magic value 15 to event.wait() ? That parameter is passed to class _Verbose to indicate if debug messages should be displayed or not, so typical values would be 0/1 or False/True. -- -- Guilherme H. Polo Goncalves -- http://mail.python.org/mailman/listinfo/python-list -- -- Guilherme H. Polo Goncalves ok here is the problem... I don't know what is the correct way... The only demos i have from the paramiko library use a hostkeyfile. since i don't have that i thought i would use the get_remote_key to get the key and then connect it using the code in the demo.. But clearly nothing is working...I should not HAVE to use the key since i should be able to authenticate using the password... Can you please suggest the right way to go ? You don't need to use key to authenticate using username and password, indeed. And you don't. Your first email was almost correct, you just needed to add event.wait() after t.auth_password. It worked here after doing that change. You can check out my version
Error on FTP Upload .. No such file or directory
--- Code -- remotepath = /incoming f = FTP(host) f.login(username,password) f.cwd(remotepath) localfile =C:\\test.txt fd = open(localfile,'rb') path,filename = os.path.split(localfile) f.storbinary('STOR %s' % filename,fd) fd.close() f.quit() Error Traceback (most recent call last): File P:\Working\Python code\temp.py, line 21, in ? uploadFile(C:\\test.txt) File P:\Working\Python code\temp.py, line 16, in uploadFile f.storbinary('STOR %s' % filename,fd) File C:\Python23\lib\ftplib.py, line 415, in storbinary conn = self.transfercmd(cmd) File C:\Python23\lib\ftplib.py, line 345, in transfercmd return self.ntransfercmd(cmd, rest)[0] File C:\Python23\lib\ftplib.py, line 327, in ntransfercmd resp = self.sendcmd(cmd) File C:\Python23\lib\ftplib.py, line 241, in sendcmd return self.getresp() File C:\Python23\lib\ftplib.py, line 214, in getresp raise error_perm, resp ftplib.error_perm: 553 test.txt: No such file or directory. Disclaimer This e-mail and any attachments is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Waterstone Capital Management, L.P and affiliates. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this e-mail in error. You should also be aware that e-mails are susceptible to interference and you should not assume that the contents of this e-mail originated from the sender above or that they have been accurately reproduced in their original form. Waterstone Capital Management, L.P. and affiliates accepts no responsibility for information, or errors or omissions in this e-mail or use or misuse thereof. If in doubt, please verify the authenticity with the! sender. -- http://mail.python.org/mailman/listinfo/python-list
Error on FTP Upload .. No such file or directory
By the way... test.txt does exist Disclaimer This e-mail and any attachments is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Waterstone Capital Management, L.P and affiliates. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, printing, forwarding or copying of this email is strictly prohibited. Please contact the sender if you have received this e-mail in error. You should also be aware that e-mails are susceptible to interference and you should not assume that the contents of this e-mail originated from the sender above or that they have been accurately reproduced in their original form. Waterstone Capital Management, L.P. and affiliates accepts no responsibility for information, or errors or omissions in this e-mail or use or misuse thereof. If in doubt, please verify the authenticity with the! sender. -- http://mail.python.org/mailman/listinfo/python-list