最近新买了个搬瓦工服务器,用控制面板装了Ubuntu 22.04 LTS,默认的是精简版本,没觉得没什么问题省点硬盘挺好的,差点什么我自己装上就好了。
我首先开始安装fail2ban,但是直接人傻了,装了上去之后启动不来,一直提示
Failed during configuration: Have not found any log file for sshd jail
我还以为是搬瓦工改了默认配置把sshd的log放在了不同的地方,因为搬瓦工默认是改ssh端口+给你个随机密码的
但是看了半天没看到他重新改到了哪里.....
最后才发现是Minimized ubuntu根本就没log文件....只活在journalctl里....
你得自己去安装个软件包才有....
解决方案: sudo apt-get install rsyslog
或者 unminimize
I got bitten by this when I tried to configure
fail2ban
on a "minimal" Ubuntu 20.04 LTS image. On Ubuntufail2ban
looks for authentication events in/var/log/auth.log
. However, in the "minimal" image only thesystemd
"journal" facility is available, the fileauth.log
is missing and thenfail2ban
won't start. To get the good old log files back, I installedrsyslog
:
sudo apt-get install rsyslog
and then
fail2ban
started working properly.Credit where credit is due: the idea for this solution came from @Bloodden 's answer which seems to be somewhat unfairly voted down...
https://unix.stackexchange.com/questions/108241/debian-auth-log-missing-from-var-log
文章评论