06-29-2020 05:56 AM
Solved! Go to Solution.
07-02-2020 03:34 AM - edited 07-02-2020 03:39 AM
So - Finally - with some debugging on the script and on the router - debug ip ssh client -
I noticed that the router was arguing about a PASSWORD value...
By accident, I encountered this command on a router:
"ip ssh server algorithm authentication public key keyboard password"
In my opinion, do check your IP ssh server settings.
I tested the script on that router and it worked.
And indeed, I ran the script 'live' :-) and I had some routers responding and some did not. In the end, they all had that line not correctly configured. I guess its time to also adjust that uniformization :-)
BTW, if I continue to make posts like these and solve them myself I will earn more badges (^^Evil Lough!)
Good luck and sleep tight
07-02-2020 03:34 AM - edited 07-02-2020 03:39 AM
So - Finally - with some debugging on the script and on the router - debug ip ssh client -
I noticed that the router was arguing about a PASSWORD value...
By accident, I encountered this command on a router:
"ip ssh server algorithm authentication public key keyboard password"
In my opinion, do check your IP ssh server settings.
I tested the script on that router and it worked.
And indeed, I ran the script 'live' :-) and I had some routers responding and some did not. In the end, they all had that line not correctly configured. I guess its time to also adjust that uniformization :-)
BTW, if I continue to make posts like these and solve them myself I will earn more badges (^^Evil Lough!)
Good luck and sleep tight
08-22-2020 08:53 AM
This requires a fairly basic adjustment to the paramiko script if you are using the higher level paramiko.client.SSHClient class. If it is failing auth due to the fix to this bug just change to using the Transport class. It's just a few more lines. See below.
import paramiko
t = paramiko.Transport((host_or_ip, 22))
t.connect(username=username, password=password)
ssh = paramiko.SSHClient()
ssh._transport = t
stdin, stdout, stderr = ssh.exec_command('show version')
print('OUTPUT')
print(stdout.readlines())
print('ERROR')
print(stderr.readlines())
ssh.close()
t.close()
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide