<!DOCTYPE html>
paramiko的使用模擬sshhtml
ssh=paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname="localhost",port=22,username='name',password='123'
stdin,stdout,stderr=ssh.exec_command('df')
result=stdout.read()
print(result.decode())
res,err=stdout,read(),stderr.read()
result=res if res else err
transport=paramiko.Transport(('hostname',port))
transport.connect(username='name',password='123')
sftp=paramiko.SFTPClient.from_transport(transport)
sftp.put('本地文件','上傳到服務器位置')
sftp.get('服務器文件位置','本地放的位置')
transport.close()