python远程创建文件夹上传文件
import paramiko import os ip='115.29.223.111'; username='11t'; password='111'; transport = paramiko.Transport((ip, 22)) transport.connect(username=username, password=password) sftp = paramiko.SFTPClient.from_transport(transport) ssh = paramiko.SSHClient(); ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname=ip, port=22, username=username, password=password) ssh.exec_command('mkdir -p /root/ss/'); #上传文件 sftp.put('C:/Users/Administrator/Desktop/Windows.c', '/root/ss/Windows.c')