2020
11-08
11-08
python如何利用paramiko执行服务器命令
话不多说直接上代码封装连接@staticmethoddefconnect(ip,server_user,server_port,server_path):"""连接服务器:param::return:"""ssh=paramiko.SSHClient()private_key=paramiko.RSAKey.from_private_key_file('{}.ssh/id_rsa'.format(server_path))ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())try:ssh.connect(ip,port=server_port,username=server_user,...
继续阅读 >