Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def oratab(ip, username,password):
- # ip = '10.10.10.10'
- # username = 'root'
- # password = 'password'
- remote_conn_pre = paramiko.SSHClient()
- remote_conn_pre.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- remote_conn_pre.connect(ip, username, password, look_for_keys=False,
- allow_agent=False)
- ... the function returns the files listing on Linux machine
- def reply(ip, username, password):
- showinfo(title='Reply', message=list(oratab(ip, password, username)))
- top = Tk()
- Label(top, text='enter IP: ').pack()
- ent = Entry(top)
- ent.pack()
- Label(top, text='enter username: ').pack()
- ent2 = Entry(top)
- ent2.pack()
- Label(top, text='enter password: ').pack()
- ent3 = Entry(top)
- ent3.pack()
- btn = Button(top, text='Submit', command=(lambda: reply(ent.get(), ent2.get(), ent3.get())))
- btn.pack()
- top.mainloop()
- > addrinfos = socket.getaddrinfo(hostname, port, socket.AF_UNSPEC, socket.SOCK_STREAM)
- > gaierror: [Errno 10109] getaddrinfo failed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement