I have a Linux server running Ubuntu 22.04., and I am able to connect to it via ssh on LAN (ssh user@192.168.X.XX
), but I am unable to connect via WAN. So if I try to run ssh -p 22 user@<router ext.ip>
, I always get the following error code (I have already set up port forwarding):
Unable to negotiate with <IP address> port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
But, since my router does not have constant IP address, I have set up dynamic DNS and even if I try ssh -p 22 user@XXXX.ddns.net
, I am still getting the same error code.
What I have already tried
- this answer from Unix & Linux SE
But then I am getting this error:
Unable to negotiate with <IP address> port 22: no matching cipher found. Their offer:
3des-cbc
And If I try to force 3des-cbc
with ssh -c 3des-cbc user@XXX.ddns.net
, then I, once
again, get this error:
Unable to negotiate with <IP address> port 22: no matching key exchange method found.
Their offer: diffie-hellman-group1-sha1
- Update
~/.ssh/config
and/etc/ssh/ssh_config
with
Host XX.XX.XX.XX
Ciphers 3des-cbc
KexAlgorithms +diffie-hellman-group1-sha1
However, that is also not giving any result (the same error msg)
3. Update / Reinstall / Stop - Start service / Disable - Enable service
This is also not working.
NOTE: I am using openssh-server
, version (1:8.9p1-3)
.
What should I do now?