The last
command will show user logins, logouts, system reboots and run level changes.
The lastlog
command "reports the most recent login of all users".
The file /etc/syslog.conf
will show how your log files are configured. For example, it may show that auth
and authpriv.*
facilities are logged to /var/log/auth.log
. In other cases, such as Ubuntu, look at /etc/rsyslog.conf
and the files in /etc/rsyslog.d
for this information.
Your log files will probably be rotated, so in addition to looking at files such as /var/log/auth.log
, you may need to look in their older counterparts such as /var/log/auth.log.1
and /var/log/auth.log.n.gz
(using zcat
) where "n" could be any integer depending on how your rotation is set up.
Although the files can be manipulated by the users, sometimes you can look at ones such as ~username/.bash_history
. Even files like ~username/.lesshst
can have useful information if you really need to dig deep.