關閉selinux和iptables

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

  連接爲https://blogs.oracle.com/jsmyth/entry/selinux_and_mysql。linux

  文章當中說到了兩種解決方法,一個是錘子,一個是手術刀。本人如今水平有限,就只用錘子就能夠了,簡單有效。sql

  永久性的關閉selinuxoracle

  編輯文件 /etc/selinux/configspa

# 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 來查看是否關閉成功。blog

若是出現Disabled,就表示你關閉成功了。three

 

如今是永久中止iptables的時候。ip

先查看iptables的狀態。ci

輸入命令 systemctl status iptables.service get

若是出現Active: active (exited) 表示你仍是開着的。

想要關閉的話很簡單,

先用systemctl stop iptables.service

而後再用systemctl disable iptables.service 就能夠了。

相關文章
相關標籤/搜索