Linux - 启动服务的三种方式

以启动和管理ssh服务为例

1. 通过init.d 启动

  • /etc/init.d/ssh status 查看服务状态
  • /etc/init.d/ssh start 启动服务
  • /etc/init.d/ssh stop 停止服务
  • /etc/init.d/ssh restart 重启服务

2. 通过service启动

  • service ssh status 查看服务状态
  • service ssh start 启动服务
  • service ssh stop 停止服务
  • service ssh restart 重启服务

3. 通过systemctl启动

  • systemctl status ssh 查看服务状态
  • systemctl start ssh 启动服务
  • systemctl stop ssh 停止服务
  • systemctl restart ssh 重启服务
  • systemctl enable ssh 设置开机启动
  • systemctl disable ssh 禁用开机启动
posted @   箫笛  阅读(3846)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
点击右上角即可分享
微信分享提示