允许root用户登录ssh(Ubuntu)

作者: cayman 分类: 服务器技术 发布时间: 2016-10-10 14:44
  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

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注