[root@localhost targeted]# pwd
/etc/selinux/targeted
[root@localhost targeted]# getsebool -a|grep samba
samba_create_home_dirs --> off
samba_domain_controller --> off
samba_enable_home_dirs --> off
samba_export_all_ro --> off
samba_export_all_rw --> off
samba_run_unconfined --> off
samba_share_fusefs --> off
samba_share_nfs --> off
use_samba_home_dirs --> off
virt_use_samba --> off
[root@localhost targeted]# setsebool samba_create_home_dirs on

chcon

关闭SELinux的方法:
  修改/etc/selinux/config文件中的SELINUX="" 为 disabled ,然后重启。
  如果不想重启系统,使用命令setenforce 0
注:
setenforce 1 设置SELinux 成为enforcing模式
setenforce 0 设置SELinux 成为permissive模式
  在lilo或者grub的启动参数中增加:selinux=0,也可以关闭selinux

#---------------------------------------------------------------
查看selinux状态:
/usr/bin/setstatus -v
如下:
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: enforcing
Policy version: 21
Policy from config file: targeted

getenforce/setenforce查看和设置SELinux的当前工作模式。

Linux关闭防火墙

1) 重启后永久性生效:

  开启: chkconfig iptables on

  关闭: chkconfig iptables off

  2) 即时生效,重启后失效:

  开启: service iptables start

  关闭: service iptables stop

  需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。

  在开启了防火墙时,做如下设置,开启相关端口,

  修改/etc/sysconfig/iptables 文件,添加以下内容:

  -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

  -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

  或者:

  /etc/init.d/iptables status 会得到一系列信息,说明防火墙开着。

  /etc/rc.d/init.d/iptables stop 关闭防火墙

建议的关闭防火墙命令是

  iptables -P INPUT ACCEPT

  iptables -P FORWARD ACCEPT

  iptables -P OUTPUT ACCEPT

  iptables -F

注:
fedora下:

  /etc/init.d/iptables stop

SElinux以及防火墙的关闭的更多相关文章

  1. Linux 防火墙和SELinux的开启和关闭

    防火墙(firewalld) 临时关闭防火墙 systemctl stop firewalld 永久防火墙开机自关闭 systemctl disable firewalld 临时打开防火墙 syste ...

  2. Centos7防火墙和SELinux的开启和关闭

    在虚拟机里面开启多个服务,对应多个端口,在防火墙开启的情况下,就要对外开放端口,这样客户端才能正常访问,但比较繁琐,关闭更直接点. 防火墙 临时关闭防火墙 systemctl stop firewal ...

  3. centos 7 中防火墙的关闭问题

    新安装的centos 7 发现有些程序端口是关闭的,想到了防火墙和selinux  selinx 好关闭 /etc/sysconfig/selinux 中 追加 SELINUX=disabled 防火 ...

  4. centos6和centos7防火墙的关闭

    CentOS6.5查看防火墙的状态: [zh@localhost ~]$service iptable status 显示结果: [zh@localhost ~]$service iptable st ...

  5. zookeeper做集群后启动不了,大部分原因是防火墙未关闭

    zookeeper做单机版,可以正常启动:但是zookeeper做集群后启动不了,大部分原因是防火墙未关闭. centos的关闭防火墙方法比较独立. systemctl stop firewalld. ...

  6. CentOs7 使用iptables防火墙开启关闭端口

    CentOs7 使用iptables防火墙开启关闭端口   # 0x01介绍 iptables命令是Linux上常用的防火墙软件,是netfilter项目的一部分iptables文件设置路径:命令:v ...

  7. Linux CentOS中防火墙的关闭及开启端口

    注:CentOS7之前用来管理防火墙的工具是iptable,7之后使用的是Firewall 样例:在CentOS7上安装tomcat后,在linux本机上可以访问tomcat主页,http://ip: ...

  8. CentOS 6和CentOS 7防火墙的关闭

    CentOS6.5查看防火墙的状态: 1 [linuxidc@localhost ~]$service iptable status 显示结果: 1 2 3 4 5 [linuxidc@localho ...

  9. [转]CentOS 6和CentOS 7防火墙的关闭

      CentOS6.5查看防火墙的状态: 1 [linuxidc@localhost ~]$service iptable status 显示结果: 1 2 3 4 5 [linuxidc@local ...

随机推荐

  1. jquery 表格排序,实时搜索表格内容

    jquery 表格排序,实时搜索表格内容   演示 XML/HTML Code <table class="table-sort"> <thead> < ...

  2. Windoows窗口程序四

    子窗口的创建 .创建时要设置父窗口句柄 .创建风格要增加WS_CHILD|WS_VISIBLE HWND CreateChild(LPSTR lpClassName,LPSTR lpWndName,H ...

  3. Java 构造方法的执行过程(猜测)

    先说明一点,这篇帖子的内容都是我自己思考的结果,如有误,请务必及时告诉我,非常感谢. 起由: public class NewThread implements Runnable{ Thread t; ...

  4. bt开源的客户端——xbt client

    我部署好了bt tracker, 用bitcomet可以下载. 但xbt client下载不来.torrent资源.

  5. 50个必备的实用jQuery代码段(转)

    1. 如何创建嵌套的过滤器: //允许你减少集合中的匹配元素的过滤器, //只剩下那些与给定的选择器匹配的部分.在这种情况下, //查询删除了任何没(:not)有(:has) //包含class为“s ...

  6. python 模块之间相互引用

    模块层级关系: ----: |->AA.py |->BB.py |->CC.py AA.py from BB import BB class AA: def sub(self, x) ...

  7. 云计算中auto-scaling 最早的来源

    什么是弹性?首先,整合计算资源,将计算资源池化,通过虚拟机按需使用计算资源;其次,按量计费,让用户能够根据使用量按月按时甚至按秒来进行付费. 不过,光有了这两条还不够.为什么?我举个例子: 很多做运维 ...

  8. asp.net mvc清空指定cookies

    HttpCookie hc = Request.Cookies["user"];                hc.Expires = DateTime.Now.AddDays( ...

  9. 修改查看MYSQL字符集(charset)

    From: http://www.cnblogs.com/fengqingtao/archive/2010/11/23/1885220.html 查看mysql的字符集 mysql> show ...

  10. 【Java NIO的深入研究2】RandomAccessFile的使用

    RandomAccessFile RandomAccessFile是用来访问那些保存数据记录的文件的,你就可以用seek( )方法来访问记录,并进行读写了.这些记录的大小不必相同:但是其大小和位置必须 ...