配置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. Egret 入门

    居然使用 TyptScript... 先贴手册地址:http://www.typescriptlang.org/docs/tutorial.html. 先要接受一个诡异的写法: private loa ...

  2. 【HDOJ】1078 FatMouse and Cheese

    这道题目是典型的DFS+记忆化搜索, DP思想.符合:含重叠子问题,无后效性等特点. #include <cstdio> #include <cstring> #include ...

  3. POJ1068 Parencodings(模拟)

    题目链接. 分析: 水题. #include <iostream> #include <cstdio> #include <cstring> using names ...

  4. 【转】Android开发学习笔记:EditText的属性介绍

    原文网址:http://liangruijun.blog.51cto.com/3061169/627350 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追 ...

  5. 网页a标签:导航制作 怎么让鼠标经过A标签的时候显示块状背景?

    文章出处:http://dongguan.seosrx.net/website/6.html

  6. Java web App 部署静态文件

    以 Tomcat 为例子,静态文件,如 html, css, js ,无需编译,所以只需要把文件复制到 Tomcat/webapps 目录下面某个子目录,便可以了. 例子: 1. 在 Tomcat/w ...

  7. [LeetCode] 219. Contains Duplicate II 解题思路

    Given an array of integers and an integer k, find out whether there are two distinct indices i and j ...

  8. Hackerrank 2020 February 2014 解题报告

    Hackerrank 2020 February 2014 解题报告 比赛链接 Sherlock and Watson (20分) 题意:给定一个数组,向右平移K次,然后有Q个询问,问第x位置上是几 ...

  9. ubuntu修改系统环境变量文件导致起不来

    修改/etc/environment文件导致系统起不来. 长按shift,进入恢复界面,然后以root方式登录命令行界面 然后vi修改/etc/environment文件 提示:Unable to o ...

  10. top -Hp pid 显示所有的线程

    可以显示所有的线程 top -Hp pid [root@jiangyi01.sqa.zmf /home/ahao.mah] #top -Hp 41330 top - 22:49:40 up 27 da ...