配置selinux

[root@localhost samba]# getsebool -a | grep samba 查找selinux中对samba的限制项
samba_domain_controller --> off
samba_enable_home_dirs --> off
samba_export_all_ro --> off
samba_export_all_rw --> off
samba_share_nfs --> off
use_samba_home_dirs --> off
virt_use_samba --> off

[root@localhost samba]# setsebool -P samba_export_all_rw=1(=0是关闭)
[root@localhost samba]# setsebool -P samba_export_all_ro=1
[root@localhost samba]# getsebool -a | grep samba
samba_domain_controller --> off
samba_enable_home_dirs --> off
samba_export_all_ro --> on(如果只读共享的文件只开此项就行)
samba_export_all_rw --> on(如果读写,只开此项就行,修改文件时要看文件的chmod属性。)
samba_share_nfs --> off
use_samba_home_dirs --> off
virt_use_samba --> off

如不想共享文件可运行如下语句

[root@localhost samba]# setsebool -P samba_export_all_rw=0
[root@localhost samba]# setsebool -P samba_export_all_ro=0

在iptables和selinux中放行smb服务的更多相关文章

  1. centos中selinux功能及常用服务配置

    SELinux: Secure Enhenced Linux 常用命令 获取selinux的当前状态: # getenforce 临时启用或禁用: # setenfoce 0|1 永久性启用,需要修改 ...

  2. 关闭Linux中的iptables,firewalld,SELINUX

    firewalld 停止firewalld服务 [root@VM_0_13_centos var]# systemctl stop firewalld 或 [root@VM_0_13_centos v ...

  3. iptables与SELinux

    iptables: 开始配置我们来配置一个filter表的防火墙.(1)查看本机关于IPTABLES的设置情况 [root@tp ~]# iptables -L Chain INPUT (policy ...

  4. CentOS 7.0如何安装配置iptables和seLinux以及firewalld

    一.配置防火墙,开启80端口.3306端口 CentOS .0默认使用的是firewall作为防火墙,这里改为iptables防火墙. .关闭firewall: systemctl stop fire ...

  5. smb服务问题解析,区别红帽6和CentOS7

    最近在学习smb服务,哇!简直问题多的不要不要的.因为以前是学习的红帽6的系统,现在用的是CentOs7,所以还是改不了以前的一些配置方式,造成了很多问题.快成地中海了! 我们准备环境: 系统: 服务 ...

  6. centos7搭建smb服务

    1 yum install samba samba-client samba-common -y  安装smb服务 2 cp -a  /etc/samba/smb.conf /etc/samba/sm ...

  7. [转载]SELinux 环境下网络服务设置,配置 Apache 、Samba、NFS

    原文地址:http://www.ibm.com/developerworks/cn/linux/l-cn-selinux-services1/index.html?ca=drs- 引言 SELinux ...

  8. ubuntu14.4.4安装smb服务实现文件共享

    1.软件安装,ubuntu14需要安装的软件有3个 安装服务前养成习惯 sudo apt-get upgrade 首先切换到超级用户  su - root sudo apt-get install s ...

  9. CentOS6.5(4)----宿主机无法访问虚拟机中的web服务解决方案

    宿主机无法访问虚拟机中的web服务 在Windows7宿主机中的VMware虚拟机中安装了CentOS6.5操作系统,并且基于Nginx搭建了Web服务器,网页刚刚搭建好的时候,通过宿主机的浏览器可以 ...

随机推荐

  1. centos 下搭建 php环境(1)

    3.PHP的安装 安装GD库(让PHP支持GIF,PNG,JPEG) 首先下载 jpeg6,libpng,freetype 并安装模块 wget http://www.ijg.org/files/jp ...

  2. JavaEmail

    一.邮件相关基本概念   a)邮件服务器:某厂商提供的电子邮件服务器的集群(或群集)   b)电子邮箱:邮件服务器上提供的个人或企业的邮件空间   c)邮件传输协议:邮件服务器之间,和个人或企业与邮件 ...

  3. SANS top 20

    What Are the Controls?The detailed Consensus Audit Guidelines are posted at http://www.sans.org/cag/ ...

  4. Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0

    如果遇到这个问题,首先考虑以下原因: 你是否在setText()方法中设置了一个int型变量,比如setText(10). 这样Android系统就会主动去资源文件当中寻找, 但是它不是一个资源文件I ...

  5. 【HDOJ】1314 Numerically Speaking

    学了几天的Java了,终于独立A了一道大数计算.感觉还得练Java啊. import java.util.Scanner; import java.math.BigInteger; import ja ...

  6. 【数学】HDU 5761 Rower Bo

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5761 题目大意: 船在(0,a),船速v1,水速v2沿x轴正向,船头始终指向(0,0),问到达(0, ...

  7. 【2013长沙区域赛】部分题解 hdu4791—4801

    1001: 签到题,二分一下即可 代码: #include <set> #include <map> #include <cmath> #include <c ...

  8. 在SQL中使用自定义函数

      由于数据库的一个表字段中多包含html标签,现在需要修改数据库的字段把html标签都替换掉.当然我可以通过写一个程序去修改,那毕竟有点麻烦.直接在查询分析器中执行,但是MS SQL Server并 ...

  9. 使用FTPClient进行文件服务器内文件的上传和下载

    我用的FTPClient是由Apache组织的commons-net.jar包中的API,这个包用起来非常的方便,很容易上手.我在项目开发的过程中主要用到了文件的上传和下载功能,下面将我开发的代码贴出 ...

  10. 判断一个js对象,是否具有某个属性

    一个对象,想必我们关注的最多的应该是它上面的属性有哪些吧.那么,怎么判断一个对象是否具有某个属性呢? /*下面是一个对比,看看在判断是否包括一个键上面,Object结构和Set结构的写法不同.*/ / ...