Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import paramiko
  2.  
  3. def start_connection():
  4. u_name = 'root'
  5. pswd = ''
  6. port = 22
  7. r_ip = '198.x.x.x'
  8. sec_key = '/mycert.ppk'
  9.  
  10. myconn = paramiko.SSHClient()
  11. myconn.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  12. my_rsa_key = paramiko.RSAKey.from_private_key_file(sec_key)
  13.  
  14. session = myconn.connect(r_ip, username =u_name, password=pswd, port=port,pkey=my_rsa_key)
  15. ...
  16. ...
  17.  
  18. follow python code to perform some actions on remote machine.
  19.  
  20. ImportError: No module named asn1crypto.algos
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement