cancel
Showing results for 
Search instead for 
Did you mean: 

Python eaps_checker script: problems connecting via Paramiko SSH

Python eaps_checker script: problems connecting via Paramiko SSH

Patrick_Hanft
New Contributor
Hi@all, my first post here!

I'm trying to use python to gather different information from different switches, which is why I started with the eaps_checker script posted on github, to connect to switches and execute commands there. I also did tests, using exactly this script. It allows to connect either via telnet or via SSH using paramiko library.

While connecting with telnet worked for both, the original eaps_checker and my own script, as long as we had telnet enabled, I now need to use SSH for connecting, as telnet was disabled for security reasons.

Unfortunately connecting via SSH does neither work with the original eaps_checker nor with my own script (which does basically exactly the same). Trying to use OpenSSH manually I get errors like

no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
which is not nice, but as I think now, not really the root cause.

The error for eaps_checker.py and my script looks like this:

python2 ~/workspace/github/ExtremeScripting/EXOS/Python/eaps_checker/check_eaps.py -f Alle_IPs.txt -u admin -p XXXXX --ssh [Eaps checker version 1.01] [+] Checking switch: 10.4.0.10 Traceback (most recent call last): File "/home/patrick/workspace/github/ExtremeScripting/EXOS/Python/eaps_checker/check_eaps.py", line 365, in main() File "/home/patrick/workspace/github/ExtremeScripting/EXOS/Python/eaps_checker/check_eaps.py", line 331, in main MySess = SSH2EXOS(switch,args.user,args.password) File "/home/patrick/workspace/github/ExtremeScripting/EXOS/Python/eaps_checker/check_eaps.py", line 80, in __init__ self.client.connect(switch,username=user,password=password) File "/usr/lib/python2.7/site-packages/paramiko/client.py", line 380, in connect look_for_keys, gss_auth, gss_kex, gss_deleg_creds, gss_host) File "/usr/lib/python2.7/site-packages/paramiko/client.py", line 597, in _auth raise saved_exception paramiko.ssh_exception.AuthenticationException: Authentication failed.
Unfortunately I'm not really a huge python expert, so my skills in debugging the problem myself might not be the best. So my hope is, somebody here also ran into this or a similar problem, while trying to use paramiko library for connecting with SSH to an XOS switch.

Used ExtremeXOS version is 15.6.4.2 v1564b2-patch1-3
12 REPLIES 12

Patrick_Hanft
New Contributor
So, I just did a test with EXOS 21.1.1.4 and paramiko 2.0 and this also worked without problems. As paramiko says to not being able to support and test against other SSH implementations than OpenSSH and as you said 21+ and 16.2+ switch to OpenSSH, I will spare the effort to file a bug.

To everyone who stumbles across this: just keep in mind, if you want to use paramiko against EXOS 16.1 or below, to use paramiko < 2.0.

Works with and without. Maybe paramiko 2.0 is more intelligent about if a key is applicable or not.

Thanks for testing. did you set "look_for_keys=False"?

Patrick_Hanft
New Contributor
Oh, I did test against 15.6.4.2 and got it working, using look_for_key=False and paramiko 1.16. Maybe paramiko 2.0 will not have issues with the new ssh server, but I will test that eventually later. But thanks for mentioning, that also 16.2 will also get the ssh server upgrade!

BTW, there's no way for me to add a "solved" or "answered" to this thread, is there? 😉
Patrick

GTM-P2G8KFN