Advertisement
Guest User

Untitled

a guest
Aug 5th, 2015
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. 23 if __name__ == "__main__":
  2. 24 for host in hosts:
  3. 26 s = paramiko.SSHClient()
  4. 28 s.load_system_host_keys()
  5. 29 s.connect(host.strip(),port,allow_agent=True)
  6. 30 for command in comms:
  7. 31 stdin, stdout, stderr = s.exec_command(command)
  8. 32 print stdout.read() + stderr.read()
  9. 33
  10. 34 s.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement