Re: Using paramiko rsa key

2009-02-10 Thread loial
On 10 Feb, 17:08, "Martin P. Hellwig" 
wrote:
> loial wrote:
> > Can anyone be a little more helpful than Tino?
>
> 
> I'll do some freebie hints :-)
> What I would do is try first whether key authentication works at all,
> for example following a tutorial 
> likehttp://the.earth.li/~sgtatham/putty/0.53b/htmldoc/Chapter8.html
>
> And if that works translate it to the relevant python code.
>
> --
> mph

Thanks..I'll try that first
--
http://mail.python.org/mailman/listinfo/python-list


Re: Using paramiko rsa key

2009-02-10 Thread Martin P. Hellwig

loial wrote:

Can anyone be a little more helpful than Tino?


I'll do some freebie hints :-)
What I would do is try first whether key authentication works at all, 
for example following a tutorial like 
http://the.earth.li/~sgtatham/putty/0.53b/htmldoc/Chapter8.html


And if that works translate it to the relevant python code.

--
mph
--
http://mail.python.org/mailman/listinfo/python-list


Re: Using paramiko rsa key

2009-02-10 Thread loial
Can anyone be a little more helpful than Tino?

I have generated the key file as follows on windows and ftp'd the
id_rsa.pub file to the .ssh directory on the server and renamed to
authorized_keys


import paramiko


key = paramiko.RSAKey.generate(2048)

key.write_private_key_file('Z:/id_rsa')
file = open('Z:/id_rsa.pub','w')
file.write("ssh-rsa " +key.get_base64())
file.close()

But when I try to connect as follows I get an authentication failed
error.


import paramiko

paramiko.util.log_to_file('demo_sftp.log')

try:
try:
key = paramiko.RSAKey.from_private_key_file("Z:/id_rsa") #the
generated private key
except Exception, e:
print str(e)
t = paramiko.Transport(('10.5.1.15', 22))
print "here"
t.start_client()
t.auth_publickey('prod2',key)

if t.is_authenticated():
print "Got it!"
sftp = paramiko.SFTPClient.from_transport(t)
dirlist = sftp.listdir('.')
print "Dirlist:", dirlist
t.close()
except Exception, e:
print str(e)
t.close()



--
http://mail.python.org/mailman/listinfo/python-list


Re: Using paramiko rsa key

2009-02-10 Thread Tino Wildenhain

loial wrote:

I want to connect via ssh from a python script on windows to an AIX
server running openSSH using rsa keys rather than a password.

Can anyone provide me with /point me at  a simple tutuorial on the
steps I need to go though in terms of geneerating the key, installing
on the server and connecting in my python code?


Sure, where can we send the invoice too?

Regards
Tino


smime.p7s
Description: S/MIME Cryptographic Signature
--
http://mail.python.org/mailman/listinfo/python-list


Using paramiko rsa key

2009-02-10 Thread loial
I want to connect via ssh from a python script on windows to an AIX
server running openSSH using rsa keys rather than a password.

Can anyone provide me with /point me at  a simple tutuorial on the
steps I need to go though in terms of geneerating the key, installing
on the server and connecting in my python code?

Thanks in advance.



--
http://mail.python.org/mailman/listinfo/python-list