The project team today reported that one 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 & ndash; anlpt | grep22 method for viewing. Speaking of this, if it is Centos7, if we want to use the netstat command, net-tools must be installed before
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.
| |
Install yum instatll net-tools-y ----netstatTools |
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.
| |
yum reinstall openssh-server |
Installation complete
After installation, the file contains ssh file information.
Restart the sshd file.
| |
Systemctl start sshd --- start the sshd service |