You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
SSH log in issue
Solution for SSH start failure
Copy page
Download PDF
Solution for SSH start failure
This topic describes how to troubleshoot and resolve the issue where the SSH service fails to start even though no error messages are displayed when you use the service or systemctl command to start it in a Linux instance environment.​
Causes​
This issue is usually caused by an abnormal configuration of the PATH environment variable or the removal of files related to the SSH package.​
Procedure​
  1. Log in to the target instance. For operation details, refer to Logging in to Linux instances.​
  1. Execute the following command to check whether the environment variable configuration is specified as expected.​
  • ​
    echo $PATH​
    ​
  • Normally, information similar to the following is returned. This value is the default value of the PATH environment variable.​
  • ​
    /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin​
    ​
  • If other information (not the default value) is returned, the environment variable is altered from its default. Execute the following command to reset the environment variable.​
  • ​
    export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin​
    ​
  1. Execute the following command to find and confirm the path of the SSHD program. Then, determine whether files related to the SSH software package are removed.​
  • ​
    find / -name sshd​
    ​
  • If the output shows information similar to the following, the default path of the SSHD program exists (the files exist). Skip the subsequent operations.​
  • ​
    /usr/sbin/sshd​
    ​
  • If no similar information is returned after you execute the find / -name sshd command, the files do not exist. Continue with the subsequent operations.​
  1. Execute the following command to reinstall the SSH package.​
  • ​
    yum install -y openssh​
    ​
  1. Execute the following command to restart the SSH service.​
  • ​
    systemctl restart sshd.service​
    ​
  1. Execute the following command to view the SSH service status.​
  • ​
    systemctl status sshd.service​
    ​
  • If the following output is displayed, the SSH service is running.​
  • ​​​
Last updated: 2026.06.18 17:49:51