loginctl: command not found

loginctl is a command line utility used to manage and control the systemd-logind login manager, which is used to manage user logins and sessions on Linux systems using systemd. It provides a variety of functions, including starting and stopping user sessions, listing active sessions and users, and managing the settings and properties of user sessions.

loginctl is an essential tool for system administrators and developers who need to manage and control the systemd-logind login manager. It provides a flexible and convenient interface for controlling user sessions and managing the settings and properties of the login manager, making it an important part of the systemd system management suite.

If you encounter the below error while running the command loginctl:

loginctl: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install systemd
Ubuntu apt-get install systemd
Arch Linux pacman -S systemd
Kali Linux apt-get install systemd
CentOS yum install systemd
Fedora dnf install systemd
Raspbian apt-get install systemd

loginctl Command Examples

1. Print all current sessions:

# loginctl list-sessions

2. Print all properties of a specific session:

# loginctl show-session session_id --all

3. Print all properties of a specific user:

# loginctl show-user username

4. Print a specific property of a user:

# loginctl show-user username -->
5. Execute a `loginctl` operation on a remote host:
# loginctl list-users -H hostname
Related Post