A scp tool based on paramiko
sudo apt-get install -y libssl-dev
sudo apt-get install -y python3-dev
- set
config.py
host = {
'hostname': '172.0.0.1',
'user': 'someone',
'pwd': 'secret'
}
- ssh exectue cmd
from scptool import ssh_execute
cmd = 'pwd; ls -l'
ssh_execute(cmd)
- scp put file
from scptool import scp_put_file
local_file_path = './data'
remote_dir_path = '/home/deploy/'
scp_put_file(local_file_path, remote_dir_path)