全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 927|回复: 12
打印 上一主题 下一主题

[疑问] 请教老哥,问个SSH登录的问题

[复制链接]
跳转到指定楼层
1#
发表于 2023-2-23 13:54:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
微信图片_20230223135343.png (19.16 KB, 下载次数: 1)

已经设置了,为什么还能用密码登录呢?
先谢谢了
2#
发表于 2023-2-23 13:58:35 | 只看该作者
重启sshd了吗
3#
 楼主| 发表于 2023-2-23 14:01:32 来自手机 | 只看该作者
xuh 发表于 2023-2-23 13:58
重启sshd了吗

重启了,我没修改,系统自带的配置就这样,很神奇
5#
发表于 2023-2-23 14:28:39 来自手机 | 只看该作者
还有其他的.d文件夹
6#
发表于 2023-2-23 14:32:40 | 只看该作者
本帖最后由 acpp 于 2023-2-23 14:34 编辑

可以用用 sudo sshd -T 输出目前配置看是否正确,很大可能是 /etc/ssh/sshd_config.d/*.conf 里面有配置文件存在,导致覆盖了。
7#
 楼主| 发表于 2023-2-23 14:36:16 | 只看该作者
acpp 发表于 2023-2-23 14:32
可以用用 sudo sshd -T 输出目前配置看是否正确,很大可能是 /etc/ssh/sshd_config.d/*.conf 里面有配置文 ...

里面有个空文件,没有内容
8#
发表于 2023-2-23 14:45:19 | 只看该作者
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the KbdInteractiveAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via KbdInteractiveAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and KbdInteractiveAuthentication to 'no'.
UsePAM no

这个呢,yes的话就可以密码
9#
 楼主| 发表于 2023-2-23 15:04:33 | 只看该作者
萌䒤萌 发表于 2023-2-23 14:45
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If t ...

多谢老哥,折腾了,我直接后台用密钥。
10#
发表于 2023-2-23 15:15:27 | 只看该作者
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
KbdInteractiveAuthentication no

啊,是这个,上次折腾好一会,忘了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-12-15 18:38 , Processed in 0.205506 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表