Creating multiple SSH connections at a time using Paramiko
问题 The code below runs grep in one machine through SSH and prints the results: import sys, os, string import paramiko cmd = "grep -h 'king' /opt/data/horror_20100810*" ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect('10.10.3.10', username='xy', password='xy') stdin, stdout, stderr = ssh.exec_command(cmd) stdin.write('xy\n') stdin.flush() print stdout.readlines() How can I grep five machines all at once (so that I don't have major delay), than put