使某服务自动启动

systemctl enable httpd.service

使某服务不自动启动

systemctl disable httpd.service

检查服务状态

systemctl status httpd.service

显示所有已启动服务

systemctl list-units --type=service

启动某服务

systemctl start httpd.service

停止某服务

systemctl stop httpd.service

重启某服务

systemctl restart httpd.service

 

 

开启防火墙22端口

iptables -I INPUT -p tcp --dport 22 -j ACCEPT

关闭SElinux:

修改/etc/selinux/config文件中的SELINUX="" 为disabled

彻底关闭防火墙

sudo systemctl status firewalld.service

sudo systemctl stop firewalld.service

sudo systemctl disable firewalld.service

posted on 2021-02-20 15:26  回忆唯U你  阅读(128)  评论(0编辑  收藏  举报