gpt4 book ai didi

linux - 哪个Linux程序将失败的sshd登录尝试写入/var/log/btmp Centos 7

转载 作者:太空宇宙 更新时间:2023-11-04 12:04:14 26 4
gpt4 key购买 nike

失败的 ssh 尝试被记录到/var/log/btmp,除了使用服务器上存在的用户名的尝试,例如根。

最初我认为/etc/pam.d/sshd 中的一个模块处理 btmp 日志记录并且可能以某种方式过滤尝试,但我只能找到有关成功登录尝试的信息 pam_lastlog

我是否在寻找正确的区域,sshd -> pam -> 日志文件?

是否可能应用过滤器来忽略现有的用户尝试?

注意:我禁用了密码和 root ssh 登录。运行 Centos 7

最佳答案

在这种情况下,sshd 负责将失败的登录尝试写入/var/log/btmp 文件。

引自Wikipedia

These files are not set by any given PAM module (such as pam_unix.so or pam_sss.so) but are set by the application performing the operation (e.g. mingetty, /bin/login, or sshd). As such it is the obligation of the program itself to record the utmp information.

以上的确认可以在网上找到,比如这个bug report

尽管 PAM 不负责写入/var/log/btmp,pam_lastlog可以写入/var/log/wtmp(登录和注销的记录),并且可以从/var/log/btmp 读取

关于linux - 哪个Linux程序将失败的sshd登录尝试写入/var/log/btmp Centos 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51245105/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com