Unable to Remotely Connect to Linux Instance
Faults
Users cannot remotely connect to Baidu Cloud Compute.
Fault causes
- [Incorrect login password](#Incorrect login password)
- [Public IP not bound or incorrect IP entered](#Public IP not bound or incorrect IP entered)
- [Network exception](#Network exception)
- [System failure](#System failure)
- [Exceptional CPU and memory usage on server](#Exceptional CPU and memory usage on server)
- [Remote connection not permitted](#Remote connection not allowed)
- [Root user login prohibited](#Root user login prohibited)
- [Incorrect security group rule setting](#Incorrect security group rule setting)
- [Host Security blocks local IP](#Host Security blocks local IP)
Troubleshooting process
If you are unable to connect to a Linux instance using remote software, first ensure the local environment is functioning correctly. If the issue persists, troubleshoot step by step by accessing the cloud server through VNC.
Local detection process

Fault diagnosis process via VNC login

Fault handling
Incorrect login password
Verify whether the password is entered correctly. If you forget the password, you can reset the password according to the reference:
- Log in to the Baidu AI Cloud console, navigate to Products - Compute - Baidu Cloud Compute (BCC).
- Locate the instance, click More on the right, and select Instance Settings - Reset Password. Note that as resetting password will force a reboot of the server, it is recommended that this operation should be performed during off-peak business hours.

If you confirm the entered password is correct but receive an error report "Incorrect password", report the problem via the Ticket System for assistance from the technical personnel of Baidu AI Cloud.
Public IP not bound or incorrect IP entered
- In the console, verify the EIP binding status. For details, click the BCC Instance Name and check the Basic Information section to confirm if an EIP is bound. If no EIP is bound or if the bound EIP has expired, you can purchase or renew as needed. If an EIP is already bound, follow the subsequent troubleshooting steps.


- Ensure the IP address used for the remote connection matches the one shown in the console. If the address is incorrect or a private IP is used directly, the connection will fail. If the connection still doesn't succeed after confirming the correct IP, proceed with further troubleshooting.
Network exception
Verify whether the local network and server network function normally. The troubleshooting steps are as follows:
- Access other websites from the local computer to confirm the local network functions normally.
- Attempt the remote connection via another local computer. If the problems persist, contact local IT or the operator to resolve network problems before proceeding to the next step.
-
Perform a ping+tracert test on the Public IP from your local computer. If the server cannot be pinged, taking CentOS 6 as an example, follow these steps to enable ping. For other systems, search for specific steps of relevant versions:
Plain Text1 iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT 2 3 iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT
If ping+tracert is normal after testing but remote connection still fails, provide complete screenshots of the tests via the Ticket System to the technical personnel of Baidu AI Cloud for the assist in troubleshooting.
System failure
If remote connection fails, attempt to sign in to the server via VNC to determine whether the server system functions normally. Subsequent troubleshooting can also be performed via VNC. For details, refer to Remotely log in to Baidu Cloud Compute via VNC as follows:
- Sign in to Baidu AI Cloud console, select Product Service - Compute - Baidu Cloud Compute (BCC).
- Locate the instance that cannot be remotely connected and click VNC Remote on the right.

If you can sign in to the server via VNC, the system will operate normally and troubleshooting can be conducted step by step. If VNC login fails, report the problem via the Ticket System for assistance from the technical personnel of Baidu AI Cloud.
Exceptional CPU and memory usage on server
If VNC login succeeds, check the server CPU and the memory usage as follows:
- Execute top to view current CPU and memory usage.

-
If a process is consuming significant resources, terminate the process on the premise of making a snapshot, and then observe whether remote connection is possible. The specific steps are as follows:
- When running the top command, the first column displays the Process ID. For example, if the "hosteye" process appears in the first row, its Process ID is 2016.

- Execute
ps -ef | grep 2016to view detailed process information. If it is confirmed that the consuming significant resources process is exceptional and not initiated by you, you may executekill -9 IDto kill the process.

After terminating the process, check again to see if the remote connection is successful. If the problem persists, continue troubleshooting with the next steps.
Remote connection not allowed
If remote connection to the Linux server fails, first verify whether sshd is started and listens to port 22. Sign in to the device via VNC and proceed with the troubleshooting according to the following steps:
- Execute
service sshd statusto verify whether SSH is started.

- If it is not started, first start or restart sshd:
service sshd start/restart -
After setting SSH, set the firewall to permit port 22. Taking CentOS 6 as an example, execute the following commands:
iptables -A INPUT -p tcp --dport 22 -j ACCEPT /etc/rc.d/init.d/iptables save /etc/rc.d/init.d/iptables restart /etc/init.d/iptables status
If other versions of servers encounter similar issues, search on Baidu for specific instructions on allowing port 22 for those versions. If the remote connection still fails after configuration, follow the troubleshooting steps outlined below.
Root user login prohibited
To verify whether sshd configuration file permits root login (taking CentOS6 as an example), sign in to the device via VNC and proceed with the troubleshooting according to the following steps:
Access the sshd configuration file: vim /etc/ssh/sshd_config, and change PermitRootLogin to yes.

If remote connection still fails after the setting, proceed with the troubleshooting according to the following steps:
Incorrect security group rule setting
Verify whether port 22 is permitted in the Security Group and whether a fixed source IP is set. First, [Create a Default Security Group](BCC/Operation guide/Security/Security group/Create a security group.md), and then proceed with testing:
If the security group settings are correct but the remote connection still fails, continue troubleshooting with the steps outlined below.
Host Security blocks local IP
Attempt to connect with the server from another computer. If the connection succeeds from another computer but fails locally, check whether the local IP is blocked by Host Security. Refer to Login Management for specific steps of troubleshooting:
- Access Product Services - Security & Management - Host Security in the Baidu AI Cloud console.

- Click the BCC instance that cannot be signed in to, and then click "View Details" on the right-hand side.

- View login events to check whether the local IP is blocked.

- If your Public IP is blocked, unblock it and add the IP to the Allow List.

- After adding the IP to the Allow List, attempt the remote connection again. If the connection failure persists, report the problem via the Ticket System for assistance from the technical personnel of Baidu AI Cloud.
