代码远程下载
def remote_scp(host_ip,remote_path,local_path,username,password): t = paramiko.Transport((host_ip,22)) t.connect(username=username, password=password) # 登录远程服务器 sftp = paramiko.SFTPClient.from_transport(t) # sftp传输协议 src = remote_path des = local_path sftp.get(src,des) t.close()
原文:http://www.cnblogs.com/yexiaochong/p/5459489.html