Troubleshoot problem using SSH automation with Paramiko through existing Python script

Job ID: 32014512

Budget: $10 – $30 USD

I have a Python script using Paramiko to run interactive SSH commands. I can SSH into a Linux server and running commands without any issues, but I have a specific appliance where Paramiko fails to run the interactive commands.

Remote access to the specific appliance will be required to troubleshoot.

Below is the output of the error when attempting to run the script on the appliance:
----------------------------------

bash-4.2$ python3 ssh_cmd.py -c ssh_config.json
2021-11-02 11:47:21,076 : DEBUG : MainThread : Trying to connect 10.x.xxx.xx as test
/usr/lib/python3.6/site-packages/paramiko/rsakey.py:119: CryptographyDeprecationWarning: signer and verifier have been deprecated. Please use sign and verify instead.
algorithm=hashes.SHA1(),
2021-11-02 11:47:22,027 : DEBUG : MainThread : Connected to 10.x.xxx.xx
2021-11-02 11:47:22,028 : DEBUG : MainThread : executing cmd: show image ver
Traceback (most recent call last):
File "ssh_cmd.py", line 120, in <module>
main(args)
File "ssh_cmd.py", line 108, in main
perform_ssh(config_data)
File "ssh_cmd.py", line 93, in perform_ssh
client.execute_command(command)
File "ssh_cmd.py", line 70, in execute_command
stdin, stdout, stderr = self.ssh_client.exec_command(cmd)
File "/usr/lib/python3.6/site-packages/paramiko/client.py", line 441, in exec_command
chan.exec_command(command)
File "/usr/lib/python3.6/site-packages/paramiko/channel.py", line 60, in _check
return func(self, *args, **kwds)
File "/usr/lib/python3.6/site-packages/paramiko/channel.py", line 234, in exec_command
self._wait_for_event()
File "/usr/lib/python3.6/site-packages/paramiko/channel.py", line 1161, in _wait_for_event
raise e
File "/usr/lib/python3.6/site-packages/paramiko/transport.py", line 1798, in run
ptype, m = self.packetizer.read_message()
File "/usr/lib/python3.6/site-packages/paramiko/packet.py", line 391, in read_message
header = self.read_all(self.__block_size_in, check_rekey=True)
File "/usr/lib/python3.6/site-packages/paramiko/packet.py", line 256, in read_all
raise EOFError()
EOFError
bash-4.2$

------------------------------------

Python script and JSON configuration file will be provided upon award of project.
Related categories: Python Linux Shell Script