Re: Q: paramiko/SSH/ how to get a remote host_key

2008-01-30 Thread Charles_hans
Thank you, Guilherme. I was running demo_sftp.py included in paramiko download. It seems that '.ssh/known_hosts' should be the path of a key file on my working directory on local PC. (Right?) I replaced this with 'test_rsa.key' in C:\paramiko-1.7.2\demos and this did not generate error. But the r

Re: Q: paramiko/SSH/ how to get a remote host_key

2008-01-30 Thread Guilherme Polo
2008/1/30, Charles_hans <[EMAIL PROTECTED]>: > > I tried to get what host_key has been aquired after AutoPolicy is set. I > added the following code just before client.close() in rosty's final code: > > try: > host_keys = > paramiko.util.load_host_keys(os.path.expanduser('~/.ssh/known_hosts'))

Re: Q: paramiko/SSH/ how to get a remote host_key

2008-01-30 Thread Charles_hans
I tried to get what host_key has been aquired after AutoPolicy is set. I added the following code just before client.close() in rosty's final code: try: host_keys = paramiko.util.load_host_keys(os.path.expanduser('~/.ssh/known_hosts')) except IOError: try: host_keys = paramiko.uti

Re: Q: paramiko/SSH/ how to get a remote host_key

2008-01-21 Thread Guilherme Polo
2008/1/21, DHR <[EMAIL PROTECTED]>: > Thank you! Now it works and the code looks like this: > > import paramiko > import base64 > from paramiko import AutoAddPolicy, SSHClient > > client = paramiko.SSHClient() > client.set_missing_host_key_policy(AutoAddPolicy()) > client.connect('hostIP', username

Re: Q: paramiko/SSH/ how to get a remote host_key

2008-01-21 Thread DHR
Thank you! Now it works and the code looks like this: import paramiko import base64 from paramiko import AutoAddPolicy, SSHClient client = paramiko.SSHClient() client.set_missing_host_key_policy(AutoAddPolicy()) client.connect('hostIP', username='uname', password='pass') stdin, stdout, stderr = c

Re: Q: paramiko/SSH/ how to get a remote host_key

2008-01-21 Thread Guilherme Polo
2008/1/21, DHR <[EMAIL PROTECTED]>: > I am connecting from a WindowsXP SP2 machine. When using Putty as an > SSH client, if you connect for the first time then you get somethign > like this: > > ''' The server's host key is not cached in the registry. You > have no guarantee that the server is the

Re: Q: paramiko/SSH/ how to get a remote host_key

2008-01-21 Thread DHR
I am connecting from a WindowsXP SP2 machine. When using Putty as an SSH client, if you connect for the first time then you get somethign like this: ''' The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server's rsa2 key

Re: Q: paramiko/SSH/ how to get a remote host_key

2008-01-21 Thread Guilherme Polo
2008/1/21, DHR <[EMAIL PROTECTED]>: > I'm trying to run the simpliest example form paramiko readme(Homepage: > http://www.lag.net/paramiko/), and > cannot find out how to get the remote SSH server host_key. > > > This is the code. It is supposed to connect to a remote SSH host and > execute an 'ls'