ssh cannot log in to Centos9 solution

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.

The root password is entered correctly, but SSH cannot log in to the Fedora system, and reports Password Authentication Failed 1. Log in through ssh software and report authentication failure, but the password must be fine 2. Turn off the firewall, turn off selinux, restart the server, invalid systemctl stop firewalldsystemctl disable firewalldvim /etc/selinux/config ...SELINUX=disabled...3 , Check https://blog.csdn.net/szuwangjl/article/details/108066581#comments_23482759 through another machine ssh -vvvv [email protected]

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://debugah.com/solved-linux-securecrt-login-ubuntu20-04-error-no-compatible-key-exchange-method-the-server-supports-these-methods-24422/

https://forums.vandyke.com/showthread.php?p=44102

SecureCRT SSH failed Key exchange failed solution_Xu Zhiheng's Blog-CSDN Blog_key exchange failed.

Guess you like

Origin blog.csdn.net/szuwangjl/article/details/128589095