-
使用普通用户登录Ubuntu系统,打开命令行窗口
-
更改root用户密码,命令:sudo passwd root
-
首先输入当前用户的密码
-
然后输入root账户的密码
-
确认root用户的密码
-
编辑ssh的配置文件,命令:nano /etc/ssh/sshd_config
-
在Authentication部分,注释掉“PermitRootLogin without-password”
-
在Authentication部分,添加“PermitRootLogin yes”
-
使用“Ctrl+o”保存数据,使用“Ctrl+X”退出编辑器
-
重新启动ssh服务,命令:sudo service ssh restart
-
然后就可以使用root帐号登录ssh
转载于:https://www.cnblogs.com/jiyang2008/p/8529390.html