cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
244
Views
0
Helpful
6
Replies

pyATS not connecting to device

vandongc7749
Level 1
Level 1

I am working to get pyATs working for my network. I have a test Cisco device which I can ping as well as ssh into using PuTTy and linux server terminal. I cannot on the other hand ssh into actual devices on the network using the linux server, I can access them through PuTTy. Although I am not sure if this is what I should do when trying to ssh using command prompt I get this error:

Unable to negotiate with {ip address} port {}: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1

The problem is when running my testbed file for the actual network, authentication is done using AD whereas my test device just uses the local credentials. It does not connect to the network devices, I am unsure if it is an ssh problem or something else.

 

6 Replies 6

@vandongc7749 try and allow the SSH client to use the insecure key exchange methods offered by the network devices, you can add the following lines to your SSH client configuration file (~/.ssh/config or /etc/ssh/ssh_config)

Host *
  KexAlgorithms +diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1

This will add the specified key exchange methods to the list of allowed algorithms for all hosts.

Hope this helps.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

How do I access the ssh file?

@vandongc7749 you can use vim or nano.

Hope this helps.

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

@bigevilbeard  I am unable to write to the file because it is read-only and I probably don't have the right permissions to change it. Am I stuck or is there something else I could try

@vandongc7749 i think so, can create a user-specific SSH configuration file that will override the system settings. This file is usually located at ~/.ssh/config  - note the tilde ~ symbol, which represents your user's home directory.

Hope this helps.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Still having authentication issues. From command prompt I am able to now ssh into my test devices by adding:

HostKeyAlgorithms +ssh-rsa 

to the config file. I also was able to figure out the actual user name for the network device. I am able to get to the part where I enter my password but there is a tacacs error which says:

Tacacs authentication failed