zl程序教程

您现在的位置是:首页 >  后端

当前栏目

SSH服务器拒绝了密码,请再试一次,亲测有效

ssh密码服务器密码 有效 亲测 拒绝
2023-09-11 14:14:47 时间

试过很多种方法最终找到解决的方法

一、常规方法:
在这里插入图片描述

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

亲测第二种方法有效。