The role of the/var/log/wtmp file
/var/log/wtmp is also a binary file that records information such as the number of logins and durations of each user. To View the method:You can use the last command to output the contents:
debian:/var/log# Last
Root pts/1:0.0 Thu Jul 7 23:19 still logged in
Root pts/3:0.0 Thu Jul 7 22:31 still logged in
Root pts/3:0.0 Thu Jul 7 20:17-22:24 (02:06)
Root pts/1:0.0 Thu Jul 7 20:14-22:39 (02:24)
root:0 Thu Jul 7 20:12 still logged in
Reboot system boot 2.6.10 Thu Jul 7 20:10 (03:17)
....
or with Last-f/var/log/wtmp.
Or
# who-u/var/log/wtmp
/var/run/utmp--Database of currently Logged-in users/var/log/wtmp--The database of past user logins Utmp file holds information about the users currently in the system. The wtmp file holds information about the user who has logged in to the system.
Login Record Utmp wtmp