Wednesday, August 14, 2013

/var/log/wtmp - No such file or directory


We all know that the "last" command is to find out who has recently used the system, which terminals they used, and when they logged in and out. If you type "last" in your command line and you got this:
last: /var/log/wtmp: No such file or directory
Perhaps this file was removed by the operator to prevent logging last info.

You most likely cleaned up your system logs in the /var/log/ folder a bit too carefully. But this is not a big deal to solve.

1. Recreate the file using the following command
# touch /var/log/wtmp
2. Set proper permissions
# chown root:utmp /var/log/wtmp
# chmod 0664 /var/log/wtmp
Now try the last command again.

No comments: