How Do I Resolve the Error "Failed to establish an SSH connection with the target ECS"?
Symptom
The migration task failed, and you received the error message "sms.3802 Failed to establish an SSH connection with the target ECS."
Problem Analysis
During a Linux file-level migration, an SSH connection is established between the source server and target server for data transmission. If the SSH connection is not set up, the preceding error message is displayed. You are advised to review the following parts to locate the cause of the SSH connection failure.
- Checking Whether the Target Server Is Stopped
- Checking Whether Port 22 Is Allowed in the Security Group of the Target Server and the Source IP Address Is Configured Correctly
- Checking Whether the Source Server Can Connect to the Target Server
- Checking Whether the SSH Client Is Installed on the Source Server
- Checking Whether the VPC or IP Address of the Target ECS Is Changed During the Migration
- Checking the Firewall Settings of the Source Server
Checking Whether the Target Server Is Stopped
- Log in to the management console.
- Under Compute, click Elastic Cloud Server. Locate the target ECS and view its status. If the ECS is stopped, choose More > Start in the Operation column.
Checking Whether Port 22 Is Allowed in the Security Group of the Target Server and the Source IP Address Is Configured Correctly
- Log in to the management console.
- Under Compute, click Elastic Cloud Server. In the ECS list, click the name of the target ECS.
- On the ECS details page, click the Security Groups tab. Check whether port 22 is allowed and whether the source IP address is specified correctly.
If port 22 is not allowed in the inbound direction, add an inbound rule for port 22. If such an inbound rule exists but the source IP address is not 0.0.0.0/0 or the IP address of the source server, change the source IP address to 0.0.0.0/0.
For details, see How Do I Configure Security Group Rules for Target Servers?
Checking Whether the Source Server Can Connect to the Target Server
- Log in to the source server.
- Run telnet Target server IP address Port in the error message. If the port is not reachable, check the configurations of the DNS servers, firewalls, security groups, and local networks of the source and target servers.
Checking Whether the SSH Client Is Installed on the Source Server
- Log in to the source server as user root.
- Check whether the SSH client is installed.
If the SSH path shown in the following figure is not returned, install the SSH client.
command -v ssh
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot