paramiko连接服务器
import paramiko
def connect_to_server():
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
print('------------开始连接服务器-----------')
client.connect('xxx.xxx.x.xxx', 22, username='root', password='password', timeout=5)
print('------------认证成功!.....-----------')
stdin, stdout, stderr = client.exec_command('cmd')
connect_to_server()