Centos7 cannot use ssh Login and Solution
Centos7 cannot use ssh Login and Solution
Today, the project team reported that a Centos7 server could not log on via SSH, so after logging on to the system locally, I found that the SSH service was not started, this method mainly uses the netstat-anlpt | grep 22 Method for viewing;
Speaking of this, if it is Centos7, if we want to use the netstat command, we need to install net-tools before using it.
Yuminstatllnet-tools-y ---- install
netstat
Tools
Failed to start sshd service manually. error message (port 22 is not listened)
There is no independent log for ssh in Centos7, so in message
Tail–f
/var/log/message
/usr/sbin/
The sshd file is missing.
Cd
/usr/sbin/
Does not display the sshd file or directory
So we need to reinstall it.
yumreinstallopenssh-server
Installation Complete
After installation, the file contains ssh file information.
Restart the sshd file.
Systemctlstartsshd --- start the sshd service