Ubuntu系统入门教程-新增root用户且设置允许使用root用户远程登陆
纠错,疑问,交流: 请进入讨论区或 请点击进入页面,扫码加入微信群或Q群进行交流
获取最新文章: 扫一扫加入“创客智造”公众号
Ubuntu系统入门教程-新增root用户且设置允许使用root用户远程登陆
说明:
- 本教程主要介绍如何在Ubuntu系统下新增root用户,同时设置使用ssh时,允许使用root用户登录
- 测试环境:
Ubuntu 20.04
操作步骤
- 新增root用户,连续输入两次密码
$ sudo passwd root
[sudo] password for ubuntu:
New password:
Retype new password:
passwd: password updated successfully
- 新增完之后, 切换root用户测试
$ sudo su root
- 设置允许使用root用户远程登陆,添加
PermitRootLogin yes配置到/etc/ssh/sshd_config文件里
$ sudo vim /etc/ssh/sshd_config
...
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
...
$ sudo systemctl restart ssh
- 然后在其他电脑上测试ssh远程登录root用户
参考链接
纠错,疑问,交流: 请进入讨论区或 请点击进入页面,扫码加入微信群或Q群进行交流
获取最新文章: 扫一扫加入“创客智造”公众号


















