SHARE
TWEET

Untitled

a guest Jun 25th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ip_address = sys.argv[1]
  2. username = sys.argv[2]
  3. password = sys.argv[3]
  4. new_pw = sys.argv[4]
  5.  
  6. ssh_client = paramiko.SSHClient()
  7. ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy() )
  8. try:
  9.     ssh_client.connect(ip_address, 22, username, password, look_for_keys=False, allow_agent=False)
  10. except paramiko.AuthenticationException:
  11.     result = "Authentication failed"
  12.     with open("journal.csv", "a") as suivi:
  13.         csv_writer = csv.writer(suivi)
  14.         csv_writer.writerows([ip_address,result])`
  15.      
  16. 1,9,2,.,1,6,8,.,0,.,1
  17. A,u,t,h,e,n,t,i,c,a,t,i,o,n, ,f,a,i,l,e,d
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top