相关目录
/lib/systemd/system/sshd.service //存储系统默认安装的服务单元文件,一般由软件包管理器提供。
/etc/systemd/system/sshd.service //存储本地管理员自定义的服务单元文件或者覆盖默认配置的文件。
systemctl
systemctl list-units --type=service --state=running //查看正在运行的服务
systemctl daemon-reload //重新加载 systemd 系统守护程序的配置文件
systemctl enable sshd.service //开启服务自启动
创建/etc/systemd/system/sshd.service->/lib/systemd/system/sshd.service的软链接
systemctl disable sshd.service //禁止服务自启动
删除/etc/systemd/system/sshd.service->/lib/systemd/system/sshd.service的软链接
systemctl start sshd.service //启动服务
systemctl stop sshd.service //停止服务
systemctl restart sshd.service //重启服务
systemctl status sshd.service //查看服务状态
systemctl mask sshd.service //屏蔽服务
systemctl unmask sshd.service //取消屏蔽