I was able to use the ssh and issue command on the remote server. Now I want scp files from a remote server, but that just seems impossible. I am completely new to python and Paramiko. The error is resolved in my local worm window directory. Files are supposed to come from a Mac. Any other really simple example that I can use to scp files from a remote Linux computer to a local Windows machine?
import paramiko
hostname = '192.xx.1.xx'
password = 'pop123'
username = "husbad2"
port = 22
mypath='C:\\Users\\handsonexpert\\Documents'
remotepath='/Users/ihussain/testdir/file3.txt'
t = paramiko.Transport((hostname, 22))
t.connect(username=username, password=password)
sftp = paramiko.SFTPClient.from_transport(t)
sftp.put(mypath, remotepath)
source
share