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

一、关闭防火墙

1. 先查看防火墙状态

[[email protected] ~]#

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. 关闭防火墙

[[email protected] ~]#

systemctl stop firewalld

[[email protected] ~]#

systemctl 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. 查看防火墙服务是否开机启动

[[email protected] ~]#

systemctl is-enabled firewalld

enabled  #开启

4. 关闭防火墙开机启动

[[email protected] ~]#

systemctl disable firewalld

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

rm ‘/etc/systemd/system/basic.target.wants/firewalld.service‘

[[email protected] ~]#

systemctl is-enabled firewalld

disabled

二、关闭SELinux

1. 查看当前SELinux状态

[[email protected] ~]#

getenforce

Enforcing

2. 关闭SElinux

[[email protected] ~]#

setenforce 0

[[email protected] ~]# getenforce

Permissive

3. 编辑配置文件

[[email protected] ~]#

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

时间: 2024-11-04 19:27:46

[RHEL7.1]关闭防火墙及SElinux的相关文章

centos6.6关闭防火墙和selinux

centos6.6关闭防火墙和selinux 1.查看防火墙状态 [[email protected] ~]#service iptables status 表格:filter Chain INPUT (policy ACCEPT) num  target     prot opt source               destination 1    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state REL

linux关于关闭防火墙和selinux的操作

在初学linux的时候,有防火墙和selinux时,我们对于一些操作不是很方便:比如DNS的远程访问和httpd程序的操作:所以我们需要一些操作来关闭防火墙和selinux: SElinux配置: ~]# getenforce Enforcing ~]# setenforce 0 防火墙: ~]# iptables -vnL 其执行结果中如果有防火墙规则,需要进行如下处理: Centos 6: ~]# service iptables stop ~]# chkconfig iptables of

Linux关闭防火墙、SELinux

使用root权限: Linux关闭防火墙: 1. chkconfig –list|grep iptables 2. chkconfig iptables off 永久关闭防火墙 3. chkconfig iptables on 永久开启防火墙 关闭SELinux: 编辑/etc/sysconfig/selinux文件 设置:SELINUX=disabled

CentOS 关闭防火墙和selinux

1)关闭防火墙(每个节点) [Bash shell] 1 2 service iptables stop chkconfig iptables off 2)关闭selinux(重启生效) [Bash shell] 1 vim /etc/selinux/config

centos7下关闭防火墙、selinux、挂载光盘和设置ip

使用命令修改ip地址的方法:[[email protected]~]#vi /etc/sysconfig/network-scripts/ifcfg-ens33按i可以添加修改内容ONBOOT="no"改成yes 开启网卡BOOTPROTO="dhcp" 改成none或staticIPADDR=192.168.159.129 NETEWAY=255.255.255.0GATEWAY=192.168. 159.1DNS1=8.8.8.8重启网卡服务[[email pr

centos7——关闭防火墙和SElinux

防火墙的开启和关闭: 查看防火墙状态 systemctl status firewalld #Active: inactive (dead) --表示防火墙已经关闭 临时关闭防火墙 systemctl stop firewalld 临时打开防火墙 systemctl start firewalld 永久防火墙关闭 systemctl disable firewalld 防火墙开机启动 systemctl enable firewalld SELinux的开启和关闭 查看SELinux状态 get

linux常用命令和关闭防火墙

2.        linux常用命令 Mkdir 创建 Rm -rf 删除 Chmod -R 777 权限 Mysql -uroot -r quit退出 find / -name svn 查找位置 3.        关闭防火墙和selinux Redhat使用了SELinux来增强安全,关闭的办法为: 1. 永久有效 修改 /etc/selinux/config 文件中的 SELINUX="" 为 disabled ,然后重启. 2. 即时生效 setenforce 0 关闭防火墙

rhel7的基本操作(查看IP配置,关闭防火墙,临时或永久关闭selinux,常用命令操作)

* rhel7的基本操作* 1.查看IP配置[[email protected] ~]# ls /etc/sysconfig/network-scripts/ifcfg-enp0s25 /etc/sysconfig/network-scripts/ifcfg-enp0s25查看DNS配置[[email protected] ~]# cat /etc/resolv.conf Generated by NetworkManager nameserver 114.114.114.114查看IP和主机绑

Rhel7.2的网络配置,防火墙、SELinux服务关闭及YUM源配置

1.网络配置 注:更改以上配置后需重启network服务 2.关闭防火墙的命令操作 首选检查防火墙状态#systemctl status firewalld.service 关闭防火墙:#systemctl stop firewalld.service 再次查看状态: 3.关闭SElinux的操作 临死关闭 #setenforce 0 永久关闭需修改配置文件 /etc/sysconfig/selinux 重启系统后生效 4.配置本地YUM源的步骤 首先将镜像挂载 将/etc/yum.repos.