在我的其中一台服务器Debian 9上,没有来自sshd
in的输出/var/log/auth.log
。实际上,如果我ag sshd
在中进行操作/var/log
,就不会出现。唯一的auth.log
是systemd-logind
。实际上,几乎所有的日志消息都来自systemd,这令人怀疑。只有少数零星的东西。
这是我的/etc/rsyslog.conf
(减去评论)(应为默认值):
module(load="imuxsock") # provides support for local system logging
module(load="imklog") # provides kernel logging support
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$FileOwner root
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$WorkDirectory /var/spool/rsyslog
$IncludeConfig /etc/rsyslog.d/*.conf
auth,authpriv.* /var/log/auth.log
*.*;auth,authpriv.none -/var/log/syslog
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
lpr.* -/var/log/lpr.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
mail.info -/var/log/mail.info
mail.warn -/var/log/mail.warn
mail.err /var/log/mail.err
*.=debug;\
auth,authpriv.none;\
news.none;mail.none -/var/log/debug
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
*.emerg :omusrmsg:*
中没有任何内容/etc/rsyslog.d
。我也尝试从Ubuntu 18.04计算机复制conf,但无济于事。
SSH是7.4p1-10+deb9u6
。/etc/ssh/sshd_config
是:
# cat sshd_config |grep -v '^#'|sed -e '/^$/d'
Port 22
PermitRootLogin yes
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
Rsyslog正在运行:
# systemctl status rsyslog
● rsyslog.service - System Logging Service
Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2019-05-05 15:06:20 CEST; 34s ago
Docs: man:rsyslogd(8)
http://www.rsyslog.com/doc/
Main PID: 3551 (rsyslogd)
Tasks: 4 (limit: 4915)
CGroup: /system.slice/rsyslog.service
└─3551 /usr/sbin/rsyslogd -n
May 05 15:06:20 brick systemd[1]: Starting System Logging Service...
May 05 15:06:20 brick systemd[1]: Started System Logging Service.
我依稀记得,当这个问题开始,我确实看到了从一个非常偶然的消息sshd
中auth.log
,但现在我不能证明正确。