Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. def oratab(ip, username,password):
  2. # ip = '10.10.10.10'
  3. # username = 'root'
  4. # password = 'password'
  5. remote_conn_pre = paramiko.SSHClient()
  6. remote_conn_pre.set_missing_host_key_policy(paramiko.AutoAddPolicy())
  7. remote_conn_pre.connect(ip, username, password, look_for_keys=False,
  8. allow_agent=False)
  9. ... the function returns the files listing on Linux machine
  10.  
  11. def reply(ip, username, password):
  12. showinfo(title='Reply', message=list(oratab(ip, password, username)))
  13.  
  14. top = Tk()
  15. Label(top, text='enter IP: ').pack()
  16. ent = Entry(top)
  17. ent.pack()
  18. Label(top, text='enter username: ').pack()
  19. ent2 = Entry(top)
  20. ent2.pack()
  21. Label(top, text='enter password: ').pack()
  22. ent3 = Entry(top)
  23. ent3.pack()
  24. btn = Button(top, text='Submit', command=(lambda: reply(ent.get(), ent2.get(), ent3.get())))
  25. btn.pack()
  26. top.mainloop()
  27.  
  28. > addrinfos = socket.getaddrinfo(hostname, port, socket.AF_UNSPEC, socket.SOCK_STREAM)
  29. > gaierror: [Errno 10109] getaddrinfo failed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement