Hey folks, I’m in a bit of a pickle here. I’ve been trying to set up a test environment based on John Capobianco’s YouTube video about ReAct AI Agent with pyATS and LangChain. Everything seemed fine until I ran the script.
Now I’m getting this weird error:
Unable to negotiate with 192.168.4.250 port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
I’m running the latest Ubuntu and can SSH into the device from the terminal no problem. But when I try to use the script, it’s a no-go. I’ve been banging my head against the wall for a week trying to fix this.
Anyone run into something similar? Any tips on how to get this working? I’d really appreciate some help here!
I’ve encountered this issue before when working with older network devices. The problem lies in the mismatch between the key exchange algorithms supported by your SSH client and the device.
To resolve this, you can modify the SSH configuration for pyATS. Look for a file named ‘connections.yaml’ in your project directory. Add the following lines under the device’s SSH connection details:
ssh:
arguments:
look_for_keys: False
allow_agent: False
kex_algos:
- diffie-hellman-group14-sha1
- diffie-hellman-group-exchange-sha1
This should force pyATS to use the key exchange algorithms supported by your device. If you’re still having trouble, you might need to update the device’s firmware to support more secure algorithms. Hope this helps!
yo charlie, that error’s a pain! had it b4. Try adding KexAlgorithms to ur SSH config file (/etc/ssh/ssh_config or ~/.ssh/config). Add this line:
KexAlgorithms +diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
Should fix it. lmk if u need more help!