The solution to the failure to start ssh under Linux is: 1. Use the "ping" and "telnet" commands to check whether it is a client problem. If not, it means the server problem; 2. Log in through a physical terminal Server; 3. Add the client "IP" to the server's whitelist; 3. Restart "ssh".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
1. SSH login failure error message description
An error occurs when the client connects to the server through the ssh protocol, as shown in the figure:
2. Error troubleshooting
First check whether it is a client problem, and use the ping command and telnet to check.
The ping result is shown in the figure below:
The telnet result is shown in the figure below:
ping and telnet both work, indicating that the problem is not with the client but with the server. You need to log in to the server to troubleshoot.
Although you cannot ssh to the server, generally the host will provide some methods for you to connect, such as connecting through a physical terminal.
After logging in to the server, check the /etc/hosts.allow
file to see if the client IP is in the whitelist. After checking, it is found that the client IP is not in the server's whitelist. Passvi /etc/hosts.allow
, add the client IP to the whitelist as shown below:
Then restart ssh and restart the command
service sshd restart
The client re-sshed, the login was successful, and the problem was solved.
More related articles and tutorials are recommended: linux tutorial
The above is the detailed content of Solution to failure to start ssh under linux. For more information, please follow other related articles on the PHP Chinese website!