sftp problem!

sa6113 s.payandeh at gmail.com
Sun Oct 5 02:32:38 EDT 2008


I want to use sftp from paramiko to copy a file from a windows machine to a
Linux in the network, I use this code :

host = "LinuxComputerName" (or its Ip)
port = 22
transport = paramiko.Transport((host, port))
password = "LinuxComputerPassword"
username = "LinuxComputerUserName"

transport.connect(username = username, password = password)
sftp = paramiko.SFTPClient.from_transport(transport)
filepath = '/home/test.jpg'
localpath = '/home/test.jpg'
sftp.get(filepath, localpath)

sftp.close()
transport.close()

and after runing this code I get this error:
socket.error: (10061, 'Connection refused')

What is wrong with this code?
please help me.



-- 
View this message in context: http://www.nabble.com/sftp-problem%21-tp19821106p19821106.html
Sent from the Python - python-list mailing list archive at Nabble.com.




More information about the Python-list mailing list