VM_129_78_suse:/home/remote_paramiko # cat remote.py #!/usr/bin/env python import paramiko linux_cmd = "uptime" #linux_cmd = "df -Th" haiwai_ipaddress = {'14.215.177.39','114.215.177.139','14.205.177.39','114.215.77.39','14.215.177.30'} for i in haiwai_ipaddress: print i private_key = paramiko.RSAKey.from_private_key_file('/home/remote_paramiko/id_rsa') ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname=i, port=33263, username='root') stdin, stdout, stderr = ssh.exec_command(linux_cmd) result_out = stdout.readlines() for item in result_out: print('