Centos7/Debian8 服务管理

查看当前所有运行的服务/匹配关键字

systemctl
systemctl | grep ssh

开启/关闭/重启/查看

systemctl start ssh
systemctl stop ssh
systemctl restart ssh
systemctl status ssh

或者

systemctl start ssh.service
systemctl stop ssh.service
systemctl restart ssh.service
systemctl status ssh.service

开启/关闭开机启动

systemctl enable ssh.service
systemctl disable ssh.service

更详细的参考http://www.dynacont.net/documentation/linux/Useful_SystemD_commands/

上一篇
下一篇