Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python script to copy files to remote server

import os
import paramiko

ssh = paramiko.SSHClient() 
ssh.load_host_keys(os.path.expanduser(os.path.join("~", ".ssh", "known_hosts")))
ssh.connect(server, username=username, password=password)
sftp = ssh.open_sftp()
sftp.put(localpath, remotepath)
sftp.close()
ssh.close()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #script #copy #files #remote #server
ADD COMMENT
Topic
Name
7+2 =