utmpdump: Dump UTMP and WTMP Files in Raw Format
Login attempts can be tracked in real time with the following command:
/bin/utmpdump -f /var/log/btmp
I received a Logwatch email reporting a “corruption detected in /var/log/btmp : XX time(s)” issue. By performing an Internet search for the reported issue, I found Gabriel Cánepa’s How to Monitor User Login History on CentOS with utmpdump. Cánepa describes utmpdump in depth and the fields in each utmpdump line entry.
The eight fields emitted by utmpdump are:
- session identifier
- PID
- “~~” (runlevel change) | “bw” (bootwait process) | TTY | PTY
- empty | username | reboot | runlevel
- TTY | PTY
- remote hostname | kernel version
- remote IP address
- timestamp