import paramikohost = "192.168.180.126" # 需要远程的PCport = 22 # 远程端口user = "kylin" # 登陆的用户名pwd = "kylin" # 登陆的密码# 建立SSH连接ssh = paramiko.SSHClient()ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())ssh.connect(host, port, user, pwd, timeout=10)stdin, stdout, stderr = ssh.exec_command("ifconfig")orig_result = stdout.read()str_result = orig_result.decode("UTF-8")print(str_result)