首页 > 系统服务 > 详细

关闭selinux和iptables

时间:2015-12-18 18:08:34      阅读:1311      评论:0      收藏:0      [点我收藏+]

  在上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 就可以了。

 

关闭selinux和iptables

原文:http://www.cnblogs.com/weixp/p/5057408.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!