Ubuntu 启用 root 账号
1 min readMar 15, 2020
- 正常通过ssh连接路由器
- 创建root账号的密码
sudo passwd root
3. 输入密码,无回显,输入两遍
4. 进入 root 账号
su root
5. 修改 PasswordAuthentication
vim /etc/ssh/sshd_config
6. 找到 PasswordAuthentication no,把no改成yes。
7. 重新启动下sshd服务
sudo service sshd restart
8. 修改sshd配置文件
vi /etc/ssh/sshd_config
PermitRootLogin xxxxx 改为 PermitRootLogin yes,如果这一项被注释掉了,去掉前面的#
PasswordAuthentication no 改为PasswordAuthentication yes
UsePAM yes改为UsePAM no