Guest User

Untitled

a guest
Jul 13th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import paramiko
  2.  
  3. username = "xxxx"
  4. password = "yyyy"
  5.  
  6. f = open("C:\UsersDesktop\deneme.txt")
  7.  
  8. for line in f:
  9. ip_address = line.strip()
  10. ssh_client = paramiko.SSHClient()
  11. ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  12. ssh_client.connect(hostname=ip_address, username=username, password=password)
  13.  
  14. f.close()
  15.  
  16. print ("Successfull", ip_address)
  17.  
  18. remote_connection = ssh_client.invoke_shell()
  19.  
  20. remote_connection.send("conf tn")
Add Comment
Please, Sign In to add comment