Selected topic

Who

User Management

Prefer practical output? Use related tools below while reading.

### Usage

The systemctl command allows you to start, stop, enable, or disable various system services, including those related to boot-up processes, network connections, user login sessions, and more.

#### Example Commands

- Start a Service:

bash
systemctl start service_name

- For example, to start the SSH service:
bash
systemctl start sshd

- Stop a Service:

bash
systemctl stop service_name

- To stop the SSH service:
bash
systemctl stop sshd

- Enable a Service at Boot:

bash
systemctl enable service_name

- To start the SSH service automatically when your system boots up:
bash
systemctl enable sshd

- Disable a Service from Boot:

bash
systemctl disable service_name

- To prevent the SSH service from running at boot time, you would use:
bash
systemctl disable sshd

- Check Status of a Service:

bash
systemctl status service_name

- For example, to check if the SSH service is currently active or not:
bash
systemctl status sshd

- List All Services or Run Levels:

bash
systemctl list-units --type=service
systemctl list-units --type=target

The first command lists all services, while the second is a bit more comprehensive and might also show system targets (which are essentially dependencies for services to operate correctly).

- Reload systemd Manager:

bash
systemctl daemon-reload

This command reloads the systemd manager's configuration but does not affect any running services. It's useful when changes have been made to service files.

### Note

The specific commands and their options might slightly vary depending on your Linux distribution (e.g., Ubuntu, Red Hat-based distributions). Always refer to the system documentation or help for the exact usage.