關閉selinux和iptables


  在上mysql的課的時候,老師總是提示千萬千萬一定要關閉selinux和iptables。不然可能會出現什么亂七八糟的權限問題等等。我也找到一篇文章是關於這個的。

  鏈接為https://blogs.oracle.com/jsmyth/entry/selinux_and_mysql。

  文章當中說到了兩種解決方法,一個是錘子,一個是手術刀。本人現在水平有限,就只用錘子就可以了,簡單有效。

  永久性的關閉selinux

  編輯文件 /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=enforcing
# 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
把配置文件當中的綠色部分改成disabled,然后重啟就可以了。
重啟以后,用getenforce 來查看是否關閉成功。

如果出現Disabled,就表示你關閉成功了。

 

現在是永久停止iptables的時候。

先查看iptables的狀態。

輸入命令 systemctl status iptables.service 

如果出現Active: active (exited) 表示你還是開着的。

想要關閉的話很簡單,

先用systemctl stop iptables.service

然后再用systemctl disable iptables.service 就可以了。

 


免責聲明!

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



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