Inspect and manage systemd logind sessions from the command line. 04.04.2026 | reading time: 2 min When systemd is running, `loginctl` is the administrator's direct interface to systemd-logind: he can list sessions, query properties, lock or terminate a session and enable user lingering so services survive logout. Quick incident example An administrator sees a stale desktop session and closes it to free resources; do these steps to inspect and terminate session 2: ```bash $ loginctl list-sessions SESSION UID USER SEAT TTY 1 0 root seat0 tty1 2 1000 alice seat0 tty2 $ loginctl show-session 2 Id=2 User=1000 Name=alice Active=yes State=online $ loginctl terminate-session 2 $ loginctl list-sessions SESSION UID USER SEAT TTY 1 0 root seat0 tty1 ``` Deeper options to use Do not stop at listing: `loginctl session-status` gives a readable snapshot, `loginctl show-session` prints machine-readable properties, `loginctl lock-session` and `unlock-session` control screen locking, `loginctl kill-session` forcibly ends all processes, and `loginctl enable-linger` allows a user to run user services after logout; note that many actions require system privileges and may be constrained by polkit. Where it fits in the admin toolbox `loginctl` speaks to systemd-logind, so pair it with service control and logs: use `systemctl` to manage system and user services, `journalctl` to read logs related to sessions, and classic tools like `who` or `w` to cross-check utmp information. Final perspective Mastering `loginctl` makes session-level incidents fast to resolve and lets the administrator control user-scoped services precisely; explore deeper systemd features next and consider formalizing skills with exam preparation at bitsandbytes.academy such as CompTIA Linux+ or LPIC-1. Join Bits & Bytes Academy First class LINUX exam preparation. utilities processes security boot-process