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 = "LinuxComputerN ame" (or its Ip)
port = 22
transport = paramiko.Transp ort((host, port))
password = "LinuxComputerP assword"
username = "LinuxComputerU serName"
transport.conne ct(username = username, password = password)
sftp = paramiko.SFTPCl ient.from_trans port(transport)
filepath = '/home/test.jpg'
localpath = '/home/test.jpg'
sftp.get(filepa th, 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%2...p19821106.html
Sent from the Python - python-list mailing list archive at Nabble.com.
Comment