Re: Why chdir command doesn't work with client.get_transport() ?

2008-02-06 Thread Charles_hans
Thank you, Matt, for your valuable advice! My application is converting (to sftp/ssh) a script which used ftp/telnet to load/copy/zip files with labels to/from a ClearCase server. ClearCase is a version control software similar to MS Source Safe or PVCS. The command 'ct setview aViewName' is just

Re: Why chdir command doesn't work with client.get_transport() ?

2008-02-05 Thread Charles_hans
Thank you, Matt, for your valuable advice! I did try using ';' to issue three commands at once and it works! However, I have more problems with issuing ClearCase commands, which is what I am really doing. Under telnet, I could issue commands one by one, just as typing at the command prompt. Now

Re: Why chdir command doesn't work with client.get_transport() ?

2008-02-03 Thread Charles_hans
Thank you, Martin! I think that you are right. But I can't use rsh since I am on XP to send commands to UNIX. I used telnet before. Now I am converting to ssh/sftp, which is my purpose. I put some more efforts in the following code: t = paramiko.Transport((hostname, port)) t.connect(user

Why chdir command doesn't work with client.get_transport() ?

2008-02-02 Thread Charles_hans
I am new to paramiko. I wrote a script to copy files between Solaris and XP machines as below: import paramiko def exec_command(trans, command): chan = trans.open_session() chan.exec_command(command) stdin = chan.makefile('wb') stdout = chan.makefile('rb') stderr = chan.makefi

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

2008-01-30 Thread Charles_hans
new to paramiko. How to create such a key file (with my remote host name)? Should I also load this key file into the remote server? Please advise. Thanks! Charles 1/30 2008/1/30, Charles_hans <[EMAIL PROTECTED]>: > > I tried to get what host_key has been aquired after AutoPolicy

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