防火牆的開啟和關閉:
查看防火牆狀態
systemctl status firewalld #Active: inactive (dead) --表示防火牆已經關閉
臨時關閉防火牆
systemctl stop firewalld
臨時打開防火牆
systemctl start firewalld
永久防火牆關閉
systemctl disable firewalld
防火牆開機啟動
systemctl enable firewalld
SELinux的開啟和關閉
查看SELinux狀態
getenforce #permissive模式是臨時關閉,enforcing模式是臨時打開,disabled模式是永久關閉
/usr/sbin/sestatus -v #如果SELinux status參數為enabled即為開啟狀態
臨時關閉SELinux
setenforce 0
臨時打開SELinux
setenforce 1
永久關閉SELinux
編輯/etc/selinux/config文件,將SELINUX的值設置為disabled。需要重啟機器,下次開機SELinux就不會啟動了。這時setenforce 1也打不開SELinux
在永久關閉的情況下,怎么打開SELinux
編輯/etc/selinux/config文件,將SELINUX的值設置為enabled。需要重啟機器
