1.3 KiB
1.3 KiB
RHCSA 4.5: Logs and the journal
A persistent journal, filtering by unit, priority and time, writing to
the log with logger, and finding a failed su.
Before you start
The lab keeps the journal in memory only (Storage=volatile, in
/etc/systemd/journald.conf.d/00-le-lab.conf), so it's lost at every
reboot. rsyslog still writes /var/log/messages and /var/log/secure.
Do task 1 first: messages sent before the journal is persistent are lost
at the reboot.
Tasks
- Make the journal persistent, reboot, and show the messages from the previous boot.
- Save the sshd messages of priority err and above from the last hour
to
/root/ssh-errors.txt(it may only say-- No entries --). - Send a message with priority
warningusinglogger, and find it in the journal and in/var/log/messages. - As a normal user, run
su -and type a wrong password, then find the attempt in/var/log/secure.
Hints
Storage=persistentin ajournald.conf.dfile that sorts after00-le-lab.conf(or remove the lab's file and create/var/log/journal), thensystemctl restart systemd-journald.journalctl --list-boots,journalctl -b -1.journalctl -u sshd -p err --since "1 hour ago" --no-pager.logger -p user.warning "...";journalctl -p warning -n 5.sudo grep "authentication failure" /var/log/secure.