Systemd 入门教程:实战篇。selinx,防火墙

http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-part-two.htmlhtml

关闭selinux:linux

临时:setenforce 0vim

完全关闭:tcp

vim /etc/sysconfig/selinux ,讲selinux=enforcing修改成:selinux=disable,重启系统post

CentOS 7.0默认使用的是firewall做为防火墙,使用iptables必须从新设置一下rest

一、直接关闭防火墙htm

systemctl stop firewalld.service #中止firewallblog

systemctl disable firewalld.service #禁止firewall开机启动ip

二、设置 iptables serviceci

yum -y install iptables-services

若是要修改防火墙配置,如增长防火墙端口3306

vi /etc/sysconfig/iptables 

增长规则

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

保存退出后

systemctl restart iptables.service #重启防火墙使配置生效

systemctl enable iptables.service #设置防火墙开机启动

最后重启系统使设置生效便可。

相关文章
相关标签/搜索