Image for post
Image for post
  1. 正常通过ssh连接路由器
  2. 创建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

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store