试过很多种方法最终找到解决的方法
一、常规方法:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
应该是sshd的设置不允许root用户用密码远程登录
1、修改 vim /etc/ssh/sshd_config
找到# Authentication:
LoginGraceTime 120
PermitRootLogin without passwd
StrictModes yes
改成
Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
2、重启ssh
systemctl restart sshd
二、暴力一点,重启服务器试试
三、如果尝试过N种方法还是不行则进行如下操作
1
2
3
4
5
6
7
8
1、修改 vim /etc/sshd/sshd_config
找到
UsePAM yes
改为
UsePAM no
2、重启ssh
systemctl restart sshd
亲测第二种方法有效。