Help Center/ Server Migration Service/ Best Practices/ Best Practice for Migrating Amazon Linux EC2 to Huawei Cloud ECS/ FAQs/ How Can I Log in to the Target Server with the root Username and Password via SSH After Migration?
Updated on 2026-01-07 GMT+08:00
How Can I Log in to the Target Server with the root Username and Password via SSH After Migration?
Symptom
AWS Linux uses key login by default and only supports the ec2-user account. Therefore, the target server cannot be logged in to using the root username and password after migration.
Solution
- Log in to the target server using VNC. VNC supports password login for the root user. For details, see Logging In to a Linux ECS Using VNC.
- Run the following command to set PasswordAuthentication to yes in the sshd configuration file:
vim /etc/ssh/sshd_config

- Run the following command to add PermitRootLogin:
PermitRootLogin yes
- Run the following command to restart sshd and log in as the root user using a password:
sudo /sbin/service sshd restart
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot