Ubuntu 系统直接使用 root 用户登录实例
1.设置linux root用户密码
a.打开Terminal ,并输入“sudo passwd root” 命令。
b.出现 [sudo] password for linux: 后 输入用户密码。
c.出现 Enter new UNIX password: 后输入root密码。
d.出现 Retype new UNIX password: 后确认root密码。
e.passwd: password updated successfully 后root用户密码设置成功了。
2.修改SSH 配置文件
sudo vi /etc/ssh/sshd_config
进入sshd_config 后找到并修改 PermitRootLogin 和 PasswordAuthentication 两个参数
修改为
PermitRootLogin prohibit-password
#PasswordAuthentication yes
#修改为
PermitRootLogin yes
PasswordAuthentication yes
3.重启 ssh 服务即可使用root账户登录
sudo service ssh restart