Short summary: Use built-in Linux tools (`who`, `last`, `journalctl`, `/var/log/auth.log`) and optional audit logs to identify when, why, and who triggered a server reboot.
# 1. Last boot time
who -b
# 2. Reboot history
last reboot
# 3. Previous boot shutdown/reboot events
journalctl -b -1 | grep -iE "reboot|shutdown"
# 4. Find who triggered the reboot
grep -i "reboot" /var/log/auth.log
journalctl -b -1 -u systemd-logind
# 5. See user’s last commands (replace USERNAME)
sudo cat /home/USERNAME/.bash_history | tail -n 20
# 6. Audit logs (if auditd is installed)
ausearch -m system_boot,system_shutdown --start today
Unexpected reboots cause downtime and confusion. This guide helps Linux admins, DevOps engineers, and hosting providers quickly determine when the server rebooted, whether it was intentional or a crash, and which user or process initiated the reboot.
Run:
who -b Example output:
system boot 2025-08-11 13:53 This gives the exact date and time of the last system start.
Use:
last reboot This reads from /var/log/wtmp and lists past reboot records.
To see shutdown/reboot messages from the previous boot:
journalctl -b -1 | grep -iE "reboot|shutdown" If you see systemd-reboot.service: Deactivated successfully., the reboot was clean and likely intentional.
Search authentication logs for reboot activity:
grep -i "reboot" /var/log/auth.log
journalctl -b -1 -u systemd-logind Example lines to look for:
Aug 11 13:51:08 server systemd-logind[989]: New session 1745 of user adminuser.
Aug 11 13:51:29 server systemd-logind[989]: System is rebooting. Here, adminuser was logged in just before the reboot — likely the actor who initiated it.
Check the user’s shell history (replace USERNAME):
sudo cat /home/USERNAME/.bash_history | tail -n 20 If the user had HISTTIMEFORMAT enabled, the history may include timestamps.
If auditd is enabled, use:
ausearch -m system_boot,system_shutdown --start today This can show the exact process (with PID) and the syscall that triggered the shutdown or reboot.
Check kernel messages from the previous boot:
journalctl -k -b -1 Look for “panic”, oops strings, or stack traces that indicate a kernel crash.
Yes. Authentication logs and systemd-logind entries will show the SSH session and user associated with the reboot.
Limit sudo privileges, require stronger authentication, and enable auditd so commands like shutdown and reboot are recorded centrally.
Using these commands you can quickly answer three key questions after any reboot:
who -bjournalctl -b -1/var/log/auth.log and systemd-logindArmed with this information you can respond to incidents faster and lock down your servers if reboots are unauthorized.
More troubleshooting guides:
Note: Replace the internal links above with the actual permalinks on your site and update the canonical & OG image URLs to match your blog assets.
As a Linux System Administrator, mastering the command line is key to efficiently managing servers,…
Introduction WireGuard is a fast, lightweight, and modern VPN protocol designed for simplicity and performance.If…
Securing your website with HTTPS is essential for privacy, SEO ranking, and user trust. Let’s…
If you manage Linux servers regularly, you know how important SSH (Secure Shell) is. Whether…
If you’re new to Linux or thinking about switching from Windows or macOS, this guide…
Introduction Site Reliability Engineering (SRE) has become a critical discipline in modern IT operations. The…
This website uses cookies.