What should I do if the freeze occurs when connecting to a Linux instance remotely?

Problem Description

It takes a long time to connect to the Linux instance using SSH. After entering the username and password, it will freeze for a while before entering the system. During the freezing period, use the Ctrl+C command to skip the freezing and enter the instance normally.

Problem causes

It may be due to anomalies in the global environment variable configuration file (/etc/profile) or personal environment variable configuration files (such as /root/.bash_profile, /root/.bashrc, $HOME/.bash_profile, $HOME/.bashrc), It takes a long time to read environment variables.


Modify the newly added environment variable configuration file to solve the problem of using ssh to connect to the Linux instance.

1. Remotely connect to the ECS instance.

2. Check if the following files have been updated or edited.

If updated, proceed to the next step.

• $HOME/.bash_profile
• $HOME/.bashrc
• /root/.bash_profile
• /root/.bashrc
• /etc/profile

Explanation $HOME means the current user's home directory.

3. Comment the updated environment variable.

a. Execute the following command to open the environment variable configuration file.

vi /root/.bashrc

b. Add # before the updated content to comment the updated content.

c. After editing, press the Esc key, enter :wq and press the Enter key to save and exit.

d. Execute the following command to make the environment variable take effect.

source /root/.bashrc

4. Re-connect to the instance remotely for testing to ensure that the freeze problem has been eliminated.

5. Re-modify the environment variable configuration file in the ECS instance to ensure the correctness of the modified content.

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00

phone Contact Us