cat /etc/ssh/sshd_config
PasswordAuthentication no
已经按文档改了配置文件,重启了 ssd 服务,但是重启后还是可以用密码登录。
请问还需要改什么配置吗?
cat /etc/ssh/sshd_config
PasswordAuthentication no
已经按文档改了配置文件,重启了 ssd 服务,但是重启后还是可以用密码登录。
请问还需要改什么配置吗?
|
jomalonejiaMar 31, 2023
1
怎么重启的
|
|
2
@jomalonejia Ubuntu 22.04 sudo systemctl restart sshd.service 这样的啊
|
|
jomalonejiaMar 31, 2023
3
@SeeWlind /etc/init.d/ssh restart 试试这个
|
|
4
@jomalonejia
arch@ubuntu:~$ sudo /etc/init.d/ssh restart [sudo] password for arch: Restarting ssh (via systemctl): ssh.service. arch@ubuntu:~$ exit logout Connection to frp-arm.top closed. PS C:\Users\Admin> ssh -p xxx arch@xxxxxxxx arch@frp-arm.top's password: Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-69-generic x86_64) 还是没生效呵呵哈哈哈或或 |
|
billleeMar 31, 2023 via Android
5
Keyboard-interactive 关了吗?
|
|
barathrumMar 31, 2023 via iPad
6
开 sshd 的 debug log 看看呢
|
|
texsd123Mar 31, 2023 via Android
7
xshell 有个挑战响应,这个应该也是密码登的,我关了就只能公私钥登录了
ChallengeResponseAuthentication no |
|
gulucnMar 31, 2023
8
sshd_config 文件可能存在两个 PasswordAuthentication 配置?
|
|
weiweiwitchMar 31, 2023
9
有没有重启过机器试试?
|
|
vnxiMar 31, 2023 via Android
10
把禁用密码那行放到配置文件的最上面
|
|
blankmissApr 1, 2023
11
理论上应该改了就会生效 你重新搞一个新的 sshd.config 覆盖一次试试
|
|
NidhoggRockSep 16, 2023
12
sshd_config.d 目录下有一个 50-cloud-init.conf 文件,里面就只有一句话就是开启密码登录,我把它删除好像就可以了。
|
|
13
我的系统版本是 Ubuntu22.04
sshd_config.d 目录下有一个 50-cloud-init.conf 文件,里面就只有一句话就是开启密码登录,我把它删除好像就可以了。 @gulucn 最后弄下来好像确实是这样的,只是在 Include 的文件里,而且这个还 Include 还在最顶上。 |
|
kisstrntJun 28, 2024
14
@NidhoggRock 成功了
|
|
mipaersAug 20, 2024
15
@NidhoggRock 终于找到了 感谢 我折腾了快一天
|