← Users & Permissions
Linux · Users & Permissions
How to see who is logged in and login history in Linux
See current logins with who and w, and login history with last, lastb, and lastlog.
See who is on the system now and who logged in recently. last reads the wtmp log; lastlog shows the most recent login per account.
# Logged in right now
who
w
# Recent logins and reboots (newest first)
last | head -n 20
# Failed login attempts
sudo lastb | head -n 20
# Most recent login per user
lastlogLinuxwholast