wtmp is a Unix and Linux login history file that records system logins, logouts, reboots and other session events. Tools such as who, last and accounting utilities read it to reconstruct user activity and session timing on the host.
What wtmp Is and What It Records
wtmp is a host-level session history file that records logins, logouts, reboots and related activity on Unix and Linux systems. It is part of the operating system’s audit trail for user sessions, not an access-control policy layer, and it is commonly read by utilities such as who and last to reconstruct past activity.
Because it captures historical events rather than live state, wtmp is useful for answering who used a system, when a session started or ended, and whether a host restarted. That makes it a practical source for administration, troubleshooting and basic security review.
How wtmp Is Used for Session Reconstruction
Administrators and analysts use wtmp to rebuild a timeline of user and system activity after the fact. Commands like last can summarise interactive sessions, while who and related tools expose current or recent presence depending on what the underlying environment records.
This matters because many operational questions cannot be answered from active processes alone. If a user connected briefly, if a machine rebooted unexpectedly, or if sessions overlapped in a suspicious pattern, wtmp is one of the records that can help establish the sequence of events.
In practice, wtmp is most valuable when combined with other host evidence, such as authentication logs, shell history, process execution records and audit logs. On its own, it can show timing and session boundaries, but not always the full reason for a login or what happened inside the session.
Integrity, Retention and Operational Limitations
As a local log file, wtmp inherits the weaknesses of host-based evidence: it can be rotated, truncated, overwritten or cleared if the system is compromised or poorly managed. Its value depends on retention settings, time synchronisation and the integrity of the host that writes it.
It is also a backward-looking record, so it does not tell you whether the activity was authorised, benign or malicious. A normal login and a stolen-session login may appear similar unless you correlate wtmp with stronger identity, network and endpoint evidence.
Why wtmp Matters in Incident Review
In a security investigation, wtmp can help confirm whether a host was accessed, whether a session persisted longer than expected and whether a reboot occurred around the time of an incident. Those details are often enough to narrow an incident window or validate an alert hypothesis.
It is especially useful when reviewing possible unauthorised access, because it can support questions about timing, session duration and concurrent logins. For deeper host integrity and access analysis, pair it with NIST SP 800-53 Rev 5 Security and Privacy Controls, which treats audit logging and accountability as core controls, and with MITRE ATT&CK Enterprise Matrix when you are mapping log evidence to credential access, privilege escalation or lateral movement techniques.
Risk and Threat Considerations
wtmp becomes high-value evidence when an attacker wants to hide a login, alter session history or use a compromised host to blend in with normal administrative activity. If the file is missing, truncated or untrusted, defenders may lose a key source for proving what happened on the system.
Failure mechanism: Attackers or misconfigured processes can overwrite, clear or manipulate session history, while log rotation and weak retention can erase older evidence before investigators collect it.
Impact: Incident responders may be unable to reconstruct user presence, confirm suspicious access, or establish a reliable timeline for compromise and containment.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK addresses the attack and risk surface, while NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | AU-2 — Event Logging | wtmp is a session log used for audit and accountability evidence. |
| AU-6 — Audit Record Review, Analysis, and Reporting | wtmp is reviewed to reconstruct access and session timelines. | |
| Recommendation — Log and retain host session events needed for investigation and accountability. Review session logs for anomalous logins, reboots, and timing gaps. | ||
| MITRE ATT&CK | T1070 — Indicator Removal on Host | wtmp can be targeted for clearing or tampering to erase host evidence. |
| Recommendation — Hunt for host log tampering and preserve session history before it is altered. | ||
| CIS Controls v8 | CIS-8 — Audit Log Management | wtmp is part of the host log set that supports detection and investigation. |
| Recommendation — Centralise and protect host logs so session history remains available for review. | ||
Practitioner Guidance
What to watch for: Treat wtmp as one part of a broader host-logging picture. A sensible review checks whether the file is being retained long enough, whether timestamps are consistent with other logs, and whether unexpected reboots or session patterns appear alongside other indicators.
Practitioner takeaway: Use wtmp for reconstruction, not trust. It is strongest when preserved intact and corroborated with authentication, audit and endpoint logs that can validate what the session record alone cannot prove.
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org