
# 迁移后，如何在目的端服务器开启SSH root密码登录？
#### 问题描述
由于AWS Linux默认使用密钥登录，并且仅支持ec2-user账户，因此迁移后的目的端服务器将无法使用root用户名和密码进行登录。
#### 解决方案
1. 通过VNC登录目的端服务器，VNC支持root账号和密码登录。登录方法请参考[通过VNC登录Linux ECS](https://support.huaweicloud.com/usermanual-ecs/ecs_03_0136.html)。
2. 执行以下命令，将sshd配置文件中的PasswordAuthentication设置为yes。 
   ```
   vim /etc/ssh/sshd_config
   ```
   ![](https://support.huaweicloud.com/bestpractice-sms/zh-cn_image_0000002538391501.png "点击放大")
   
   
3. 执行以下命令，新增PermitRootLogin。 
   ```
   PermitRootLogin yes
   ```
   
   
4. 执行以下命令重新启动sshd，即可使用root用户进行密码登录。 
   ```
   sudo /sbin/service sshd restart
   ```
   
   
 
