Reputation: 1329
I am trying to sftp a file from my Windows laptop to a Unix box (Juniper router).
I wrote a small script but it says I have the remote path wrong. i know there is probably something fancy I need to add so windows can translate the nix directory but I can't find it on Google :(
Here is the script:
import paramiko
host = "192.168.1.87"
port = 22
transport = paramiko.Transport((host, port))
password = "juniper123"
username = "root"
transport.connect(username = username, password = password)
sftp = paramiko.SFTPClient.from_transport(transport)
filepath = '/balls/test.txt'
localpath = 'C:\Users\python1\test.txt'
sftp.put(filepath, localpath)
sftp.close()
transport.close()
I get the error:
WindowsError: [Error 3] The system cannot find the path specified: '/balls/test.txt'
Upvotes: 4
Views: 5819
Reputation: 11531
You may also have a problem if there isn't a directory named balls off your root directory on the remote host.
Upvotes: 1