[root@linuxcool ~]# systemctl status sshd
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset>
Active: active (running) since Thu 2022-05-12 17:02:08 CST; 23s ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 3015 (sshd)
Tasks: 1 (limit: 12391)
Memory: 1.5M
CGroup: /system.slice/sshd.service
└─3015 /usr/sbin/sshd -D -oCiphers=aes256-gcm@openssh.com,chacha20-p>
May 12 17:02:08 linuxcool.com systemd[1]: Stopped OpenSSH server daemon.
May 12 17:02:08 linuxcool.com systemd[1]: Starting OpenSSH server daemon...
May 12 17:02:08 linuxcool.com sshd[3015]: Server listening on 0.0.0.0 port 22.
May 12 17:02:08 linuxcool.com sshd[3015]: Server listening on :: port 22.
May 12 17:02:08 linuxcool.com systemd[1]: Started OpenSSH server daemon.
lines 1-16/16 (END)
将指定的服务加入到开机启动项中:
[root@linuxcool ~]# systemctl enable sshd
将指定的服务从开机启动项中取消:
[root@linuxcool ~]# systemctl disable sshd
显示系统中所有已启动的服务列表信息:
[root@linuxcool ~]# systemctl list-units --type=service
UNIT LOAD ACTIVE SUB DESCRIPTION
accounts-daemon.service loaded active running Accounts Service
atd.service loaded active running Job spooling tools
auditd.service loaded active running Security Auditing Service
avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack
bolt.service loaded active running Thunderbolt system service
colord.service loaded active running Manage, Install and Gener>
crond.service loaded active running Command Scheduler
cups.service loaded active running CUPS Scheduler