温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

RHEL7中怎么关闭firewalld和SElinux

发布时间:2021-06-21 15:37:06 来源:亿速云 阅读:189 作者:Leah 栏目:大数据

RHEL7中怎么关闭firewalld和SElinux,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。

1、关闭fireealld防火墙

a. 先查看防火墙状态

[root@bogon ~]# systemctl status firewalld

--------------------------------------------------------------------------

|firewalld.service - firewalld - dynamic firewall daemon

   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)

   Active: active (running) since 一 2015-05-25 22:53:54 CST; 3min 18s ago

Main PID: 979 (firewalld)

   CGroup: /system.slice/firewalld.service

           └─979 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

   5月 25 22:53:54 localhost.localdomain systemd[1]: Started firewalld - dynami...

  Hint: Some lines were ellipsized, use -l to show in full.| 

b、关闭fireealld防火墙

[root@bogon ~]# systemctl stop firewalld      //停止防火墙

c、查看防火墙服务是否开机启动

[root@bogon ~]# systemctl is-enabled firewalld

enabled  #开启

d、关闭防火墙开机启动

[root@bogon ~]# systemctl disable firewalld

rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service' //删除

rm '/etc/systemd/system/basic.target.wants/firewalld.service' //删除

[root@bogon ~]# systemctl is-enabled firewalld

disabled //关闭

2、关闭SELinux

1、查看当前SELinux状态

[root@bogon ~]# getenforce

结果:Enforcing

2、关闭SELinux

[root@bogon ~]# setenforce 0

[root@bogon ~]# getenforce

结果:Permissive

3. 编辑配置文件

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

结果:

#This file controls the state of SELinux on the system.

#SELINUX= can take one of these three values:

#enforcing - SELinux security policy is enforced.

#permissive - SELinux prints warnings instead of enforcing.

#disabled - No SELinux policy is loaded.

SELINUX=permissive    **#修改此参数**

#SELINUXTYPE= can take one of three two values:

#targeted - Targeted processes are protected,

#minimum - Modification of targeted policy. Only selected processes are protected. 

#mls - Multi Level Security protection.

SELINUXTYPE=targeted

关于RHEL7中怎么关闭firewalld和SElinux问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注亿速云行业资讯频道了解更多相关知识。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI