Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import paramiko
- from paramiko_expect import SSHClientInteraction
- remote_conn_pre = paramiko.SSHClient()
- remote_conn_pre.set_missing_host_key_policy(
- paramiko.AutoAddPolicy())
- remote_conn_pre.connect(ip, username=username, password=password,
- allow_agent=False, look_for_keys=False)
- print ("SSH connection established to %s" % ip)
- interact = SSHClientInteraction(remote_conn_pre,timeout=100,display=True)
- interact.expect()
- interact.send(command)
- cmd_output_uname = interact.current_output_clean
- print cmd_output_uname
- pktgen@pktgen:~$
- Traceback (most recent call last):
- File "C:Python27paramikores.py", line 29, in <module>
- interact.expect()
- File "buildbdist.win32eggparamiko_expect.py", line 119, in expect
- current_buffer = self.channel.recv(self.buffer_size)
- File "C:Python27libsite-packagesparamikochannel.py", line 615, in recv
- raise socket.timeout()
- timeout
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement