Environment: Centos Stream release 9
Situation: Through the ssh method, regardless of the local login to localhost or the remote login, it fails.
Tried closing firewalld and selinux, it didn't work either. After searching and trying, it is necessary to modify the parameter of PermitRootLogin in /etc/ssh/sshd_config to yes.
This is consistent with the previous article where the root user ssh logs in to Fedora and reports an error.
TIPS:
1. When using SecureCRT v7.1.0 ssh remote Centos9 server, the prompt is as follows:
Check the SSH2 configuration of SecureCRT, you can see that the v7.1.0 version supports relatively few Key exchanges, and cannot support what the server needs, such as: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2- nistp384, ecdh-sha2-nistp521, diffie-hellman-group-exchange-sha256, diffie-hellman-group14-sha256, diffie-hellman-group16-sha512, diffie-hellman-group18-sha512
So at this time, you need to use a more advanced version of SecureCRT or other newer version of SSH tools, and it is recommended to check all supported methods.
2. Alibaba Cloud yum source of Centos Stream 8 and 9:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all && yum makecache
Reference documents:
https://www.server-world.info/en/note?os=CentOS_Stream_9&p=ssh&f=1
https://forums.vandyke.com/showthread.php?p=44102
SecureCRT SSH failed Key exchange failed solution_Xu Zhiheng's Blog-CSDN Blog_key exchange failed.