[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. MongoDB 常用shell命令汇总

    //指定用户名和密码连接到指定的MongoDB数据库 mongo 192.168.1.200:27017/admin -u user -p password use youDbName 1.Mongo ...

  2. e686. 显示打印窗口

    The print dialog allows the user to change the default printer settings such as the default printer, ...

  3. iOS推送证书从申请到使用

    关于这个话题,已经有非常多写的非常好的文章了.可是,在自己做的过程中,即使别人写的已经非常好了,还是会遇到这样那样的问题. 自己还是再写一遍吧. 本文记录了从无到有申请证书,到最后可以发出通知.当然, ...

  4. bowtie2-inspect 根据bowtie2的索引取得fasta 序列

    今天运行tophat2的时候看到下面这条记录: [2016-02-27 11:40:03] Checking for reference FASTA file Warning: Could not f ...

  5. jquery中判断选择器,找没找到元素用$().size()==0

    jquery中判断选择器,找没找到元素用$().size()==0

  6. htaccess正则规则学习笔记整理

    # —— 位于行首时表示注释. [F] —— Forbidden(禁止): 命令服务器返回 403 Forbidden错误给用户浏览器 [L] —— Last rule(最后一条规则): 告诉服务器在 ...

  7. ThinkPHP重写规则优化URL及Rewrite规则详细说明

    示例如下: http://www.topstack.cn/Article/detail/id/198.html 优化为 http://www.topstack.cn/article-198.html ...

  8. fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?

    解决方法:设置cpp文件的Precompiled Header属性设置为Not Using Precompiled Headers

  9. [深入理解Android卷一全文-第四章]深入理解zygote

    由于<深入理解Android 卷一>和<深入理解Android卷二>不再出版,而知识的传播不应该由于纸质媒介的问题而中断,所以我将在CSDN博客中全文转发这两本书的所有内容. ...

  10. Int 型数值存储

    1. Int 在计算机中占 4 Byte, 共 32 位, 最大正数为 2147483647, 最小负数为 -2147483648 2. 正数存储在计算机中的形式为原码,最大正数的十六进制形式为 0X ...