2

the log file auth.log has dissappeared on my ubuntu 14.04 server. Fail2ban log says that suddenly the file was gone:

2016-04-16 21:59:56,735 fail2ban.actions: WARNING [ssh] Ban 192.169.189.36
2016-04-17 01:27:51,182 fail2ban.filter : ERROR  Unable to get stat on /var/log/auth.log because of: [Errno 2] No such file or directory: '/var/log/auth.log'
2016-04-17 01:27:51,185 fail2ban.filter : ERROR  Unable to get stat on /var/log/auth.log because of: [Errno 2] No such file or directory: '/var/log/auth.log'

and fail2ban service finally went idle.

How can I recreate auth.log and mail.log and even more important does anybody have an idea how this could have happened? Thanks in advance for any tips.

2 Answers 2

2

You could recreate these files with following commands:

touch /var/log/auth.log && chmod 640 /var/log/auth.log && chown syslog:adm /var/log/auth.log
touch /var/log/mail.log && chmod 640 /var/log/mail.log && chown syslog:adm /var/log/mail.log

It's hard to say why the files got deleted. I have never experienced that. Maybe it could be the log-rotation if you have modified it recently.

2
  • Thank you! This worked perfectly. Both files are there again.
    – mirage
    Apr 17, 2016 at 17:57
  • NP! I'm glad that I could help.
    – sanderp
    Apr 17, 2016 at 18:00
5

For me, only the following worked:

/etc/init.d/rsyslog restart

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .