????一匙睹、關(guān)閉防火墻并禁止開(kāi)機(jī)自啟:
[root@localhost nginx-1.14.2]# systemctl disable --now firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
????二易遣、 關(guān)閉selinux:
? ? ?1潮瓶、 查看SELinux狀態(tài):
? ?1) /usr/sbin/sestatus -v ? ? ?##如果SELinux status參數(shù)為enabled即為開(kāi)啟狀態(tài)
##目前 SELinux 支持三種模式,分別如下:
???? enforcing :強(qiáng)制模式歹苦,代表 SELinux 運(yùn)作中送浊,且已經(jīng)正確的開(kāi)始限制 domain/type 了梦谜;
???? permissive:寬容模式:代表 SELinux 運(yùn)作中,不過(guò)僅會(huì)有警告訊息并不會(huì)實(shí)際限制
? ? ? ? ? ? ? ? ? ? ? ? ? domain/type 的存取袭景。這種模式可以用來(lái)作為 SELinux 的 debug 之用唁桩;
????? disabled :關(guān)閉,SELinux 并沒(méi)有實(shí)際運(yùn)作
2)getenforce ? ? ? ? ? ? ? ? ##也可以用這個(gè)命令檢查
? ? 2耸棒、關(guān)閉SELinux:
1)臨時(shí)關(guān)閉(不用重啟機(jī)器):
setenforce 0? ? ? ? ? ? ? ? ? ##設(shè)置SELinux 成為permissive模式
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ##setenforce 1 設(shè)置SELinux 成為enforcing模式
2)修改配置文件(需重啟機(jī)器):
vim /etc/selinux/config 文件
將SELINUX=enforcing改為SELINUX=disabled
或者執(zhí)行:
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
然后重啟機(jī)器即可
firewalld詳解:https://www.cnblogs.com/vicowong/p/11210144.html
selinux詳解:https://blog.csdn.net/yanjun821126/article/details/80828908