Title SecureCRT login ubuntu20.04 prompt “key exchange failed” error
When using ubuntu2004, an error will be reported when using the old version of SecureCRT to connect via SSH, as follows:
Key exchange failed.
No compatible key exchange method. The server supports these methods: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
To solve this problem, the solution is as follows:
1. Modify ssh_config
Find the following two lines in this file and remove the # in front of them
vim /etc/ssh/ssh_config
2. modify sshd_config
- add the following contents to this file
vim /etc/ssh/sshd_config
KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
3. Restart sshd service
systemctl restart sshd