I just got an Amazon EC2 micro instance with Ubuntu 12.04.
The problem is that the last command isn’t working …
The error message is :
last: /var/log/wtmp: No such file or directory
Perhaps this file was removed by the operator to prevent logging last info.
Thanks in advance !
You most likely cleaned up your system logs in the
/var/log/folder a bit too carefully.This is not a big deal to solve.
Step 1: Recreate the file using the following command
Step 2: Set proper permissions
Late edit:
Question in the comments:
The file is a log file used by the linux command last which
Sure – If I would be the intruder and I want to remove any signs of my visit I would probably remove my login from this log file, but most likely I would not delete the whole file as this would be a sign of intrusion. If I don’t care and just want to wipe my trace I might just destroy the whole machine instead.
More likely reason for the missing reason is described in the book Hardening Linux by James Turnbull when talking about
lastandlastbI am not a forensic expert, so I could not tell you how to detect an intrusion and I can’t tell for sure you’ve not be the target of a hack, but personally I believe the described reason might be more realistic.