备案 - 控制台 退出
备案 免费注册 登录
云服务器
负载均衡
云数据库
对象存储
阿里云专题
账户问题
选购指南
付款结算
合同及发票
会员相关
账号资产
安全保障
财务相关
商标注册
备案指南
管局备案要求
前置审批说明
法律法规
上架流程
服务器问题
下架流程
重装系统
常见问题
规则说明
总则
信息安全处罚规则
首次备案
备案规则
其它问题 > Linux常用系统参数设置systemctl命令
systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起。
任务
旧指令
新指令
使某服务自动启动
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
1.启动nfs服务
systemctl start nfs-server.service
2.设置开机自启动
systemctl enable nfs-server.service
3.停止开机自启动
systemctl disable nfs-server.service
4.查看服务当前状态
systemctl status nfs-server.service
5.重新启动某服务
systemctl restart nfs-server.service
6.查看所有已启动的服务
systemctl list -units --type=service
7.开启防火墙22端口
iptables -I INPUT -p tcp --dport 22 -j accept
8.关闭SElinux:运行命令getenforce,验证SELinux状态。返回结果若是enforcing,表明SELinux已开启。
getenforce
enforcing
临时关闭:执行命令setenforce 0
setenforce 0
永久关闭:
vi /etc/selinux/config
SELINUX=enforcing
SELINUX=disabled
:wq
shutdown -r now
disabled
9.彻底关闭防火墙:
sudo systemctl status firewalld.servicesudo systemctl stop firewalld.servicesudo systemctl disable firewalld.service
这条帮助是否解决了您的问题? 已解决 未解决
Copyright © 2013-2022 idca.cn. All Rights Reserved. IDCA 版权所有 湖南冬邦云互联科技有限公司 湘ICP备13011493号-2
《中华人民共和国增值电信业务经营许可证》B1-20214635 湘公网安备43020002000199
TOP