RedHat 7 關閉防火牆及SElinux

hai503發表於2017-06-30
RedHat 7.x 預設不再用iptables管理防火牆,相關命令如下:

一、關閉防火牆
1. 檢視防火牆狀態
systemctl status firewalld

2. 實時關閉(重啟恢復)
systemctl stop firewalld

3. 檢視防火牆服務是否開機啟動
systemctl is-enabled firewalld

4. 永久關閉
systemctl disable firewalld


二、關閉SELinux
1. 檢視當前SELinux狀態
getenforce

2. 實時關閉(重啟恢復)
setenforce 0

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    #修改為disabled
# 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

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12707874/viewspace-2141432/,如需轉載,請註明出處,否則將追究法律責任。

相關文章