网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

Linux下防火墙和selinux的启动、关闭和查看

CentOS7.X下:

1.防火墙

防火墙状态查看:
[root@localhost sunan]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

其中Active为inactive (dead)为关闭状态,active (running)为开启状态

创新互联主营遂溪网站建设的网络公司,主营网站建设方案,app软件定制开发,遂溪h5重庆小程序开发公司搭建,遂溪网站营销推广欢迎遂溪等地区企业咨询

关闭防火墙命令:
[root@localhost sunan]# systemctl stop firewalld.service 
开启防火墙命令:
[root@localhost sunan]# systemctl start firewalld.service
永久禁用防火墙命令(开机不自启动)
[root@localhost sunan]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
永久启动防火墙命令(开机自启动)
[root@localhost sunan]# systemctl enable firewalld.service   
Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.

CentOS6.X下:

1.防火墙

防火墙状态查看:
[root@localhost ~]# service iptables status
关闭防火墙命令:
[root@localhost ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
开启防火墙命令:
[root@localhost ~]# service iptables start
iptables: Applying firewall rules:                         [  OK  ]
永久禁用防火墙命令(开机不自启动)
[root@localhost ~]# chkconfig iptables off
永久启动防火墙命令(开机自启动)

[root@localhost ~]# chkconfig iptables on

2.selinux(CentOS7.X同CentOS6.X)

查看selinux状态:
[root@localhost sunan]# getenforce 
Enforcing

selinux状态有三种模式:
enforcing:强制模式,代表selinux运行中,且已经正确的开始限制domain/type了。
permissive:宽容模式,代表selinux运作中,不过仅会有警告信息并不会实际限制domain/type的访问。这种模式可以用来作为selinux的debug之用
disabled:关闭,selinux没有实际运行。
命令设置SELinux,前提不能是disabled状态:

[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce  
Permissive

其中setenforce 0|1
0:设置为premissive状态;
1:设置为enforcing状态;
此设置:重启系统后无效。
修改配置文件,设置selinux为disabled状态:

[root@localhost ~]# vim /etc/selinux/config

SELINUX=disabled
SELINUXTYPE=targeted

保存,重启系统生效。


网站栏目:Linux下防火墙和selinux的启动、关闭和查看
网页链接:http://bjjierui.cn/article/jipocg.html

其他资讯