loginctl
TLDR
Print all current sessions
$ loginctl
Show all properties of a session$ loginctl show-session session_id -a
Show properties of a specific user$ loginctl show-user username
Show a specific property of a user$ loginctl show-user username -p Property
Execute on a remote host$ loginctl list-users -H hostname
Log out a user from all sessions$ loginctl terminate-user username
Lock all sessions$ loginctl lock-sessions
SYNOPSIS
loginctl [OPTIONS] [COMMAND]
DESCRIPTION
loginctl controls the systemd login manager (systemd-logind). It can be used to introspect and control the state of user sessions, seats, and the login manager itself.
PARAMETERS
-a, --all
Show all properties-p, --property
Show specific property-H, --host
Execute on remote host-M, --machine
Execute in container--no-pager
Do not pipe output to pager--no-legend
Do not print header/footer
COMMANDS
list-sessions
List current sessionssession-status [ID]
Show runtime session statusshow-session [ID]
Show properties of sessionsactivate ID
Activate a sessionlock-session [ID]
Lock sessionsunlock-session [ID]
Unlock sessionslock-sessions
Lock all sessionsunlock-sessions
Unlock all sessionsterminate-session ID
Terminate a sessionlist-users
List logged-in usersuser-status [USER]
Show runtime user statusshow-user [USER]
Show properties of usersenable-linger [USER]
Enable user linger (keep services running after logout)disable-linger [USER]
Disable user lingerterminate-user USER
Terminate all sessions of a userlist-seats
List available seatsseat-status [SEAT]
Show seat status
CAVEATS
Enable-linger allows user services to persist after logout. Terminating sessions may cause data loss in running applications.
HISTORY
loginctl is part of systemd, managing multi-seat configurations, user sessions, and user lingering through systemd-logind.
SEE ALSO
systemd-logind(8), systemctl(1), lslogins(1)


