操作场景
本节操作介绍Linux云服务器切换密钥登录为密码登录的操作步骤。
操作步骤
-
使用root身份编辑Linux云服务器的ssh配置文件。
su root
vim /etc/ssh/sshd_config修改如下配置项:
–把PasswordAuthentication no 改为 PasswordAuthentication yes。
–把PermitRootLogin no 改为 PermitRootLogin yes。
-
重启sshd服务使配置生效,并查看服务状态。
systemctl restart sshd systemctl status sshd
-
设置root密码,然后就可以通过密码远程登录云主机。
passwd root