Inspect the SSH service state (the unit name may vary).
systemctl status sshInspect or manage systemd services. Service names vary by distribution.
systemctl [OPTIONS...] COMMAND [UNIT...]Inspect the SSH service state (the unit name may vary).
systemctl status sshList currently running service units.
systemctl list-units --type=service --state=running| Option / clause | Description |
|---|---|
status UNIT | Show a unit's state and recent log lines. |
start UNIT / stop UNIT | Start or stop a unit now. |
restart UNIT / reload UNIT | Restart a unit or ask it to reload its configuration. |
enable UNIT / disable UNIT | Configure whether a unit starts at boot. |
--now | With enable/disable, also start/stop the unit immediately. |
--user | Manage the calling user's service manager. |
list-units --type=TYPE | Filter the list by unit type. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.