Exemplo n.º 1
0
#encoding: utf-8
from paramiko import SSHClient

ssh = SSHClient()
ssh.connect("192.168.2.188",
            22,
            "root",
            "Xujiahui@123",
            key_filename="G:\code\config\ssh_key")
scp = SSHClient(ssh.get_transport())
local_file = "G:\code\config\hosts"
remote_file = "/tmp/ddddd"
scp.put(local_file, remote_file)
scp.close()
Exemplo n.º 2
0
from paramiko import SSHClient
from scp import SCPClient
import paramiko
from subprocess import call
import os

ssh = SSHClient()
ssh.load_system_host_keys()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('34.64.149.18', username='******', password='******')

ssh = SCPClient(ssh.get_transport())

ssh.put('/home/pi/param.py', '~/web/webthermometer/public/images/')

ssh.close()