Inspect and Manage Login Sessions with loginctl
loginctl lists active sessions and users on a systemd system and can terminate a hung session through systemd-logind.
01Command
$ loginctl list-sessions02What it does
`loginctl show-session <id>` reveals details such as the remote host, TTY, and whether the session is graphical. `loginctl list-users` and `loginctl user-status <user>` show per-user state and cgroups. Because termination goes through systemd-logind, it cleans up the session's scope properly — a safer equivalent of killing the user's processes by hand.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- loginctl(1) - Linux manual pageEvidence: loginctl may be used to enumerate and inspect sessions, and terminate-session ends the specified session.
Last verified: 2026-09-17 · Category: System & Settings
06Related solutions
timedatectl lists, sets, and verifies the system timezone and NTP sync status on systemd distributions.
hostnamectl sets the static, transient, and pretty hostname in one step on systemd distros, no reboot required.
systemctl list-timers shows every scheduled timer unit with its last and next run times, which many users forget replaces cron on modern distros.