Help Center> Bare Metal Server> FAQ> Login FAQs> What Do I Do If I Cannot Log In to a Linux BMS?

What Do I Do If I Cannot Log In to a Linux BMS?

If you cannot log in to a BMS using SSH, you are advised to remotely log in to the BMS through the console.

Check Whether You Can Remotely Log In to the BMS Through the Console

If the SSH login fails, check whether you can remotely log in to the BMS through the management console.

  1. Log in to the management console.
  2. Under Computing, click Bare Metal Server.
  3. Locate the row that contains the target BMS and click Remote Login in the Operation column.
    After about one minute, the login page is displayed. Press Enter and enter username root and the password.

    Learn about the preparations for logging in to a BMS.

If you cannot remotely log in to the BMS with the preceding instructions, record your BMS information and the time when the fault occurred. Then, create a service ticket to contact HUAWEI CLOUD technical support.

Check Network Connectivity

Check whether the EIP bound to the BMS can be pinged. If the EIP cannot be pinged, check whether the following rule has been added to the security group.

Protocol

Direction

Port Range

Source

ICMP

Inbound

All

0.0.0.0/0

After performing the preceding operations, try to remotely connect to the BMS.

Check Whether the Security Group Is Correctly Configured

Check whether port 22 of the security group is allowed.

After performing the preceding operations, try to remotely connect to the BMS.

Non-System Disk Information Is Not Commented Out in the /etc/fstab File

  1. Log in to the BMS and run the following command to edit the /etc/fstab file:

    vi /etc/fstab

  2. Comment out the data disk configuration in the /etc/fstab file.

    The /etc/fstab file contains information about the file systems and storage devices automatically attached to the BMS when the BMS starts. The configuration information about data disks automatically attached to the BMS needs to be commented out. For example, the last row shown in Figure 1 is the data disk configuration to be commented out in the /etc/fstab file.

    Figure 1 Data disk configuration in the fstab file

After performing the preceding operations, restart the BMS and try to remotely connect to it.

Check the Port for Remotely Accessing the BMS

Check the internal settings of the BMS.
  1. Check whether the BMS sshd process is running.
  2. Check whether the BMS rejects access by the local PC.
    1. Log in to the BMS and run the following command:

      vi /etc/hosts.deny

    2. If the IP address of the local PC is contained in the file, the IP address is rejected. In such a case, delete the IP address from the file.
  3. Open the /etc/ssh/ssh_config file on the local PC and check the default login port. In addition, check whether the value of the port field (SSH-enabled port) in the /etc/ssh/sshd_config file of the BMS has been changed (the default port number is 22).

After performing the preceding operations, try to remotely connect to the BMS.

Check the CPU Load

Check whether the login failure is caused by high CPU usage. If yes, perform the following operations to reduce the CPU usage:

  • Stop some processes that are not used temporarily and try again.
  • You can also restart the BMS.

    The restart operation will stop the server and interrupt services. Exercise caution when performing this operation.

  • Reinstall the OS.

    Reinstalling the OS is a high-risk operation. Back up data before the reinstallation.

After performing the preceding operations, try to remotely connect to the BMS.

If the fault persists after the preceding operations are performed, record the BMS information and the time when the fault occurred. Then, create a service ticket to contact HUAWEI CLOUD technical support.