阿里云 CentOS 7.6 启用 root 账号密码登录

  1. 控制台 -> 服务器运维 -> 远程连接

控制台

服务器列表

  1. 可以通过输入 sudo su root 切换至 root 账号。
sudo su root
  1. /etc/ssh/sshd_config 文件中的 PasswordAuthentication no 修改为 PasswordAuthentication yes 并保存。
vi /etc/ssh/sshd_config
  1. 输入如下命令 sudo service sshd restart,重启 SSH 服务后,就可以重新使用账号密码连接服务器了。
sudo service sshd restart
  1. 设置 root 账号密码,立即重启服务器。

  2. 等待 10 分钟左右,使用本地 SSH 客户端 Xshell 远程连接服务器。

posted @ 2021-03-01 09:51  clipboard  阅读(720)  评论(0编辑  收藏  举报