How to realize ssh & scp by Python

刚 王 cell2005 at pchome.net
Sat Jul 23 13:25:58 EDT 2005


I would like to write a Python code like this:

It can login a host by SSH
after login the host, use SCP to get a remote file, so it can deliver file to the host.
then execute the program
then leave the host

For example :

STEP 1. ssh xxxx_yyy at 123.45.67.89
STEP 2. Enter the password automatically 
STEP 3. run " scp -r zzz at 123.45.67.90:/home/xxx/program ."
STEP 4. Enter the password for SCP automatically 
STEP 5. run "./program"
STEP 6. run " exit"

I know telnetlib can help us with telnet, and how to deal with this SSH situation in Python?

Thanks a lot for your help :)


__________________________________________________
赶快注册雅虎超大容量免费邮箱?
http://cn.mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050724/348880c6/attachment.html>


More information about the Python-list mailing list