Il Tue, 06 Oct 2009 12:26:34 -0800, Joshua Kugler ha scritto: > David wrote: >> transport.connect(username = username, pkey = mykey) >> >> I get a "AuthenticationException: Authentication failed." exception. >> >> >> My ~/.ssh/id_rsa is correct because if, at console, I type >> >> bags...@bagvapp:~$ sftp bags...@192.168.92.129 >> Connecting to 192.168.92.129... >> sftp> >> >> I get a successful login. How can I get an sftp login without using a >> password in python? >> I am using Ubuntu 9.04, python 2.6.2 and paramiko 1.7.5 > > What is the contents of 'mykey'? Is it a file object? A string containing > the contents of ~/.ssh/id_rsa? The Paramiko docs indicate mykey should be a > subclass of PKey, probably RSAKey. > > So, you'd need to do: > > mykey = RSAKey.from_private_key_file('/path/to/private/key/id_rsa') > transport.connect(username = username, pkey = mykey)
That's exactly what I did (as clearly explained in the tutorial) but doesn't work. > > Beyond that, I"m not sure. Of course, I've never used Paramiko before. Can you suggest an alternative way to connect to an sftp server without using a passoword in python? Thanks David. -- http://mail.python.org/mailman/listinfo/python-list