could not fully run paramiko - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: could not fully run paramiko (/thread-3031.html) |
could not fully run paramiko - kajatonas - Apr-25-2017 Connection to the device is ok. But when im trying to send some commands, i get an error: stdin, stdout, stderr = ssh.exec_command('show ip int brief') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3/dist-packages/paramiko/client.py", line 405, in exec_command chan.exec_command(command) File "/usr/lib/python3/dist-packages/paramiko/channel.py", line 60, in _check return func(self, *args, **kwds) File "/usr/lib/python3/dist-packages/paramiko/channel.py", line 229, in exec_command self._wait_for_event() File "/usr/lib/python3/dist-packages/paramiko/channel.py", line 1086, in _wait_for_event raise e File "/usr/lib/python3/dist-packages/paramiko/transport.py", line 1726, in run ptype, m = self.packetizer.read_message() File "/usr/lib/python3/dist-packages/paramiko/packet.py", line 386, in read_message header = self.read_all(self.__block_size_in, check_rekey=True) File "/usr/lib/python3/dist-packages/paramiko/packet.py", line 251, in read_all raise EOFError() EOFErrorusing Python3 with Paramiko Any help? Thanks RE: could not fully run paramiko - Larz60+ - Apr-26-2017 Nice traceback, where's the code? also, for traceback use error tags. not python tags RE: could not fully run paramiko - kajatonas - Apr-26-2017 thank you for a reply. Im quite new to python so in step by step manner i do this: osboxes@osboxes:~$ python3 Python 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import paramiko >>> ssh = paramiko.SSHClient() >>> ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) >>> ssh.connect('10.35.1.1',username='admin',password='password') >>> stdin,stdout,stderr=\
As you see after sending "show version" line im getting an error.Could you explain to me, what you mean in: "for traceback use error tags. not python tags" or where to read about it ? RE: could not fully run paramiko - kajatonas - Apr-26-2017 ok, so here a little bit formated text. Is it right ? Thanks:) osboxes@osboxes:~$ python3 Python 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import paramiko >>> ssh = paramiko.SSHClient() >>> ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) >>> ssh.connect('10.35.1.1',username='admin',password='password') >>> stdin,stdout,stderr=ssh.exec_command("show version")
|