Guest User

Untitled

a guest
Jan 27th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. import paramiko
  2. import sys
  3. import os
  4. import os.path
  5. passwd = "XXX"
  6. ssh = paramiko.SSHClient()
  7. ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  8. ssh.connect("173.15.13.28", "root", password=passwd)
  9. stdin, stdout, stderr = ssh.exec_command('ls')
  10. x = stdout.readlines()
  11. print x
  12. for line in x:
  13. print line
  14. ssh.close()
  15.  
  16. Traceback (most recent call last):
  17. File "<pyshell#9>", line 1, in <module>
  18. ssh.connect("173.15.13.28", "root", password="--------")
  19. File "C:Python27libsite-packagesparamikoclient.py", line 282, in connect
  20. for (family, socktype, proto, canonname, sockaddr) in socket.getaddrinfo(hostname, port,socket.AF_UNSPEC, socket.SOCK_STREAM):
  21. gaierror: [Errno 10109] getaddrinfo failed
  22.  
  23. ssh.connect("173.15.13.28", username="root", password=passwd)
Add Comment
Please, Sign In to add comment