Linux永久關閉防火牆 firewalld和sellinux設置


 

有時候關了防火牆,下次登錄又開了,發現服務起不來,找半天才發現防火牆又開了,真是的,所以建議永久關閉防火牆和selinux

 

關閉 firewalld:

systemctl stop firewalld #臨時關閉

systemctl disable firewalld #永久關閉,即設置開機的時候不自動啟動

 

--------------------------------------

關閉 selinux:


[root@localhost html]# getenforce #查看selinux狀態
Permissive
[root@localhost html]# setenforce 0 #臨時關閉
[root@localhost html]# vim
/etc/sysconfig/selinux #永久關閉

永久關閉selinux可以使用vi命令打開/etc/sysconfig/selinux 文件將SELINUX=(disable或permissive)

##重啟服務

[root@localhost html]# shutdown -r now (或者reboot簡單粗暴)。

##附

setenforce 1 設置SELinux 成為enforcing模式
setenforce 0 設置SELinux 成為permissive模式

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM