linux7.1 防火墙,[RHEL7.1]关闭防火墙及SElinux

本文介绍了如何在Linux系统中查看并关闭firewalld防火墙服务,包括检查服务状态、停止服务以及禁止开机启动。同时,也详细说明了如何查看及临时关闭SELinux,修改其配置文件以设置为Permissive模式。
摘要由CSDN通过智能技术生成

一、关闭防火墙

1. 先查看防火墙状态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.

2. 关闭防火墙systemctl stop firewalldsystemctl status firewalld

firewalld.service - firewalld - dynamic firewall daemon

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

Active: inactive (dead) since 一 2015-05-25 23:03:56 CST; 3s ago

Process: 979 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)

Main PID: 979 (code=exited, status=0/SUCCESS)

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

5月 25 23:03:55 bogon systemd[1]: Stopping firewalld - dynamic firewall da.....

5月 25 23:03:56 bogon systemd[1]: Stopped firewalld - dynamic firewall daemon.

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

3. 查看防火墙服务是否开机启动systemctl is-enabled firewalld

enabled  #开启

4. 关闭防火墙开机启动systemctl disable firewalld

rm ‘/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service‘

rm ‘/etc/systemd/system/basic.target.wants/firewalld.service‘systemctl is-enabled firewalld

disabled

二、关闭SELinux

1. 查看当前SELinux状态getenforce

Enforcing

2. 关闭SElinuxsetenforce 0

Permissive

3. 编辑配置文件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

原文:http://leoshi.blog.51cto.com/152597/1655102

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值