This document uses the CVM with CentOS 7.5 as an example to show how to troubleshoot the problem where a Linux instance cannot be logged in to by using SSH.
During login to a Linux instance by using SSH, a message indicating that the connection is unavailable or failed appears.
Locating and Troubleshooting the Issues
Step 1: Checking the security group rule configuration
Use the port verification tool for security groups to check whether security group rules are correct.
- If the problem is caused by the security group port configuration, you can use the Open All Ports feature to open all ports. You can also customize security group rules based on your actual needs. For more information, see Adding Security Group Rules.
- If the security group port configuration is correct, proceed to the next step.
Step 2: Querying the SSHD service port
- Log in to a Linux instance by using VNC.
- On the operating system interface, run the following command to check whether a port is listened on by the SSH daemon (SSHD) service:
netstat -tnlp | grep sshd
Step 3: Checking whether the SSHD service has been launched
Run the following command to check whether the SSHD service has been launched.
systemctl status sshd.service
- If yes, submit a ticket.
- If no, run the following command to launch the SSDH service and try to log in to the Linux instance again by using SSH.
systemctl start sshd
If you still cannot log in to your instance after performing these steps, we recommend that you report this problem by submitting a ticket.