Linux中systemctl命令怎么用
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,这篇文章给大家分享的是有关Linux中systemctl命令怎么用的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。Linux常用命令systemctl命令 是系统服务管理器指
千家信息网最后更新 2026年11月02日Linux中systemctl命令怎么用
这篇文章给大家分享的是有关Linux中systemctl命令怎么用的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
Linux常用命令systemctl命令 是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起。

systemctl
系统服务管理器指令
补充说明
| 任务 | 旧指令 | 新指令 |
|---|---|---|
| 使某服务自动启动 | chkconfig –level 3 httpd on | systemctl enable httpd.service |
| 使某服务不自动启动 | chkconfig –level 3 httpd off | systemctl disable httpd.service |
| 检查服务状态 | service httpd status | systemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active) |
| 显示所有已启动的服务 | chkconfig –list | systemctl list-units –type=service |
| 启动服务 | service httpd start | systemctl start httpd.service |
| 停止服务 | service httpd stop | systemctl stop httpd.service |
| 重启服务 | service httpd restart | systemctl restart httpd.service |
| 重载服务 | service httpd reload | systemctl reload httpd.service |
实例
systemctl start nfs-server.service . # 启动nfs服务 systemctl enable nfs-server.service # 设置开机自启动 systemctl disable nfs-server.service # 停止开机自启动 systemctl status nfs-server.service # 查看服务当前状态 systemctl restart nfs-server.service # 重新启动某服务 systemctl list-units --type=service # 查看所有已启动的服务开启防火墙22端口
iptables -I INPUT -p tcp --dport 22 -j accept如果仍然有问题,就可能是SELinux导致的
关闭SElinux:
修改/etc/selinux/config文件中的SELINUX=""为disabled,然后重启。
彻底关闭防火墙:
sudo systemctl status firewalld.service sudo systemctl stop firewalld.service sudo systemctl disable firewalld.service感谢各位的阅读!关于"Linux中systemctl命令怎么用"这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
服务
命令
指令
内容
更多
状态
篇文章
系统
防火墙
管理
防火
不错
实用
上将
两个
任务
信息
实例
实际
常用
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
云南咖啡
科技与互联网
盈实互联网科技
互联网科技资迅
互联网科技社
互联网的科技创新
佰商互联网科技有限公司
互联网金融科技委员会
科技大学互联网专业好不好
中国最先进互联网科技公司
深圳前海聚择互联网科技有限公司
互联网科技博主是什么意思
燊美集互联网科技有限公司
广州新华互联网科技学校电竞方面
翼展科技 首家互联网医院
本届互联网大会上的黑科技
35岁以上互联网科技行业
广州梦谷互联网科技有限公司领导
兰石爱特工业互联网科技分公司
三亚科技创新互联网基地
咖啡豆
南京欣网互联网络科技
保险科技 互联网保险
北京路客互联网科技有限公司
互联网科技官网
福建科技产业互联网发展
昊天互联网科技有限公司
本届互联网博览会上的黑科技
民营互联网公司国防科技
中和天地互联网科技有限公司