Todos os produtos
Search
Central de documentação

:Solucionar falhas de conexão com uma instância Linux

Última atualização: Jun 22, 2026

This topic describes how to troubleshoot remote connection failures to a Linux instance.

null

Emergency access to a Linux instance: If you need immediate access to a Linux instance for operations and maintenance (O&M), use a VNC connection. VNC bypasses the network and security configurations that may be causing the issue. For more information, see Connect to an instance by using VNC.

Common causes

SSH remote connection failures can be caused by the PAM security framework, security groups, SSH settings, and other factors. Based on your scenario, use the appropriate troubleshooting method to identify and resolve the connection issue.

No specific error message

Use the self-service troubleshooting tool

The Alibaba Cloud self-service troubleshooting tool quickly checks security group configurations, the instance's internal firewall, and the listening status of common application ports, generating a clear diagnostic report.

Click to open the self-service troubleshooting page and select the target region.

The diagnostic report lists exceptions and their details. For example, it might indicate that common ports for inbound traffic are not allowed in the security group, listing details such as direction, protocol (such as ICMP), port, policy (Not Allowed), and impact. It also provides a link with a recommendation to modify the security group rule.

If the self-service troubleshooting tool does not identify the issue, follow the manual troubleshooting steps below.

Manually troubleshoot the issue

If the remote connection fails without an error message, follow these steps to troubleshoot the issue manually:

Step 1: Test remote connection with Workbench

Use Workbench to make a remote connection. Workbench returns specific error messages and solutions if the connection fails. Follow these steps:

  1. Go to ECS console - Instances.

  2. In the upper-left corner of the page, select a region and resource group.地域

  3. Click the ID of the target instance to go to the instance details page, and then click Remote connection.

  4. In the Remote connection dialog box, find Workbench and click Sign in now.

  5. Test whether you can remotely log on to the instance.

    Workbench automatically populates the basic information required to log on to the target instance. Confirm that the information is correct and enter your username and authentication credentials. For detailed steps on how to remotely log on to a Linux instance by using Workbench, see Connect to a Linux instance by using Workbench.

    • If you still cannot log on, Workbench returns an error message and a solution. Follow the instructions to resolve the issue. Then, test the remote connection again using Workbench. For information about common Workbench issues, see Troubleshoot VNC connection issues.

    • If you can log on using Workbench, the SSH service on the target instance is running correctly. This rules out SSH server-side issues. Proceed to Step 2: Check the network.

Step 2: Check the network

If you cannot remotely connect to a Linux instance, first, verify network connectivity.

  1. Test the connection from a computer in a different network environment, such as on a different subnet or from a different ISP, to isolate the issue to either your local network or the instance.

    • If the issue is with your local network or ISP, contact your local IT staff or ISP for assistance.

    • If the network interface card driver is not working correctly, reinstall it.

  2. On your local client, ping the instance to test network connectivity.

Step 3: Check the port and security group

Verify that the security group allows connections on the required remote port.

  1. Go to ECS console - Instances.

  2. In the upper-left corner of the page, select a region and resource group.地域

  3. On the Instances page, click the ID of the corresponding instance.

  4. On the Security Groups tab, find the security group and click Manage Rules in the Actions column.

  5. On the Security Group Details page, in the Access Rules section, on the Inbound tab, click Add Rule and add a rule with the following parameters.

    • Policy: Allow

    • Priority: 1 (A lower value indicates a higher priority; 1 is the highest.)

    • Protocol: Custom TCP

    • Source: Set to your local IP address. You can find your IP address at https://cip.cc/.

    • Destination (This Instance): Select SSH (22).

  6. Run the following command to test whether the port is open.

    telnet [IP] [Port]
    null
    • [IP] is the public IP address of the Linux instance.

    • [Port] is the SSH port number of the Linux instance.

    A successful response is similar to the following example from the telnet 192.168.0.1 22 command:

    Trying 192.168.0.1 ...
    Connected to 192.168.0.1.
    Escape character is '^]'

    If the port test fails, see Troubleshoot port connectivity issues on an ECS instance that can be pinged.

Step 4: Check CPU, bandwidth, and memory

High CPU load, insufficient public bandwidth, or insufficient memory can cause remote connection failures.

  1. Check if the CPU load is high and take the appropriate action.

  2. Check whether the public bandwidth is insufficient.

    Insufficient public bandwidth can cause remote connection failures. Follow these steps to investigate:

    1. Go to ECS console - Instances.

    2. In the upper-left corner of the page, select a region and resource group.地域

    3. In the instance list, click the ID of the target instance. In the Configuration Information section, check the Public Bandwidth.

      If the instance bandwidth is 0 Mbit/s, the instance has no public bandwidth. To resolve this, upgrade the bandwidth. For more information, see Modify the bandwidth of a pay-as-you-go instance.

  3. Check if there is insufficient memory.

    If you can connect to a Linux instance but the desktop does not display and the connection immediately closes without an error message, the issue may be insufficient instance memory. Check the instance's memory usage as follows:

    1. Log on to the Linux instance by using VNC.

      For more information, see Connect to a Linux instance by using a password.

    2. Check memory usage. If memory is insufficient, upgrade the instance type to resolve the resource bottleneck. For more information, see Overview of instance type upgrades and downgrades.

Specific error messages

When a remote connection fails, the system usually returns an error message. Use this message to quickly identify the cause and find a solution.

PAM security framework

The PAM security framework in Linux loads security modules to control access to server account policies, logon policies, and more. Incorrect configurations or triggering of these policies can cause SSH logon to fail. Common related errors include:

Linux instance system environment configuration

Issues in the Linux system environment, such as a virus, incorrect account configuration, or misconfigured environment variables, can also cause SSH logon to fail. Common related errors include:

SSH service and parameter configuration

The default configuration file for the SSH service is /etc/ssh/sshd_config. Incorrect parameter configurations or enabled features or policies in this file can also cause SSH logon to fail. Common related errors include:

SSH service-related directory or file configuration

For security, the SSH service checks permissions and ownership (user and group) of related directories and files at runtime. Permissions that are too permissive or too restrictive can cause the service to fail and prevent client logon. Common related errors include:

SSH key configuration

SSH uses asymmetric encryption to protect transmitted data. The client and server exchange and validate key information during connection setup. A common related error is:

"Host key verification failed" error when you use SSH to log on to an ECS instance