允许root用户登录ssh

  1. 使用普通用户登录Ubuntu系统,打开命令行窗口
  2. 更改root用户密码,命令:sudo passwd root
  3. 首先输入当前用户的密码
  4. 然后输入root账户的密码
  5. 确认root用户的密码
  6. 编辑ssh的配置文件,命令:nano /etc/ssh/sshd_config
  7. 在Authentication部分,注释掉“PermitRootLogin without-password”
  8. 在Authentication部分,添加“PermitRootLogin yes”
  9. 使用“Ctrl+o”保存数据,使用“Ctrl+X”退出编辑器
  10. 重新启动ssh服务,命令:sudo service ssh restart
  11. 然后就可以使用root帐号登录ssh
posted @ 2018-03-08 16:47  姑苏慕容复  阅读(386)  评论(0编辑  收藏  举报