我最近在Centos6.3上搭建Samba系统,按照配置都已经配置好了,当就是没法在win7下访问,老是弹出以下弹出框:

后来我在网上找资料发现有SELinux这么个东西,然后我就按照配置该了一下就成功了。配置如下:

要是想让共享目录能访问,可以使用命令
#setenforce 0
暂时停掉SELinux
使用
#setenforce 1
启用SELinux
 
有关SELinux 在系统中的作用就不讲了,另外一种方法可以不用关闭SELinux.以下命令将允许这个权限:
setsebool -P samba_enable_home_dirs=1
 
 

若SElinux啟用中,在Windows檔案總管無法連到 Samba 所分享出來的目錄時,

在Linux 中,可執行下列指令:

setsebool -P samba_enable_home_dirs on

參考文件: /etc/samba/smb.conf

#---------------
# SELINUX NOTES:
# 分享群組
# If you want to use the useradd/groupadd family of binaries please
run:
# setsebool -P samba_domain_controller on
#

# 分享home目錄
# If you want to share home directories via samba please run:
# setsebool -P samba_enable_home_dirs on

#
# If you create a new directory you want to share you should mark
it as
# "samba-share_t" so that selinux will let you write into it.
# Make sure not to do that on system directories as they may
already have
# been marked with othe SELinux labels.
#
# Use ls -ldZ /path to see which context a directory has
#
# Set labels only on directories you created!
# To set a label use the following: chcon -t samba_share_t
/path
#
# If you need to share a system created directory you can
use one of the
# following (read-only/read-write):
# setsebool -P samba_export_all_ro on
# or
# setsebool -P samba_export_all_rw on
#
# If you want to run scripts (preexec/root
prexec/print command/...) please
# put them into the /var/lib/samba/scripts directory so that smbd
will be
# allowed to run them.
# Make sure you COPY them and not MOVE them so that the right
SELinux context
# is applied, to check all is ok use restorecon -R -v
/var/lib/samba/scripts
#
#--------------
#

Samba出现“您可能没有权限使用网络资源”解决方法的更多相关文章

  1. jenkins在windows服务器上执行含git push命令的脚本权限不足的解决方法

    错误摘要 默认情况下执行脚本是没问题的,但是脚本中含有git push命令就无法执行了 用jenkins部署hexo博客时候遇到的,执行hexo d -g一直阻塞至Build was aborted, ...

  2. linux文件经 windows系统 之后出现 权限缺失 的解决方法

    把Linux下的文件拷贝到windows,再拷贝到Linux时,文件的权限丢失. 解决办法: 把文件压缩后,将压缩文件拷贝到windows系统上,再拷贝压缩文件到linux服务器,在目标linux服务 ...

  3. vss报错Workgroup无法访问,您可能没有权限使用网络资源解决办法

    xp下访问svn或者vss的时候只能使用ip进行访问表示很不爽,昨天还好好的,结果就不能使用计算机名字去访问了. 很是郁闷,打开网上邻居之后发现,居然连网上邻居都搜不出来,于是关掉windows自带防 ...

  4. php以fastCGI的方式运行在iis下,遇到的文件系统权限问题及解决方法

    今天准备将一个php demo放在IIS下运行,网站在IIS下的配置是这样的: 应用程序池是集成模式下的.net framework 2.0(2.0或4.0没什么关系,因为php以fastCGI的方式 ...

  5. Windows删除/修改注册表权限不足的解决方法

    在注册表的某些关键项(譬如:System.Root),连Administrator都没有权限进行修改,因为只有“system”有权限. [警告]切勿企图进行注册表上层权限覆盖低层权限的方式来使Admi ...

  6. 首次使用windows管理界面访问安装在UNIX或linux下的DP服务器时提示无权限访问的解决方法

    用windwos GUI管理界面连接时提示无权限访问: 在/etc/opt/omni/server/users/userlist 添加一行: "" "*" &q ...

  7. 执行Oracle存储过程报权限不足的解决方法

    当前Oracle用户sofa拥有connect.dba.resource的角色权限,但奇怪的是却没有执行Oracle Procedure的权限.后来通过查找资料发现:如果sofa用户需要执行Proce ...

  8. oracle sys可以登录,system权限不足,解决方法

    今天在自己电脑上安装了oracle 11g,安装成功后发现 sys 可以正常登录.system 无法登录,显示 ORA-01031: insufficient privileges(权限不足) sel ...

  9. sharepoint2013用场管理员进行文档库的爬网提示"没有权限,拒绝"的解决方法

    爬网提示被拒绝,场管理员明明可以打开那个站点的,我初步怀疑是:环回请求(LoopbackRequest)导致的 解决方法就是修改环回问题.修改注册表 具体操作方法: http://www.c-shar ...

随机推荐

  1. java性能

    一.关于性能的基本知识  1.性能的定义  在我们讨论怎样提高Java的性能之前,我们需要明白“性能“的真正含义.我们一般定义如下五个方面作为评判性能的标准.  1) 运算的性能----哪一个算法的执 ...

  2. javascript-函数进阶

    一.函数定义 1.函数声明 function add(i,j){ return i+j; } 特点:1.函数声明定义函数会被前置.要知道在js代码执行时,会有一个预解析,预解析时会把变量声明.函数声明 ...

  3. spark RDD的元素顺序(ordering)测试

    通过实验发现: foreach()遍历的顺序是乱的 但: collect()取到的结果是依照原顺序的 take()取到的结果是依照原顺序的 为什么呢???? 另外,可以发现: take()取到了指定数 ...

  4. Asp.net中基于Forms验证的角色验证授权

    Asp.net的身份验证有有三种,分别是"Windows | Forms | Passport",其中又以Forms验证用的最多,也最灵活. Forms 验证方式对基于用户的验证授 ...

  5. Android 中的 Service 全面总结 (转)

    原文地址:http://www.cnblogs.com/newcj/archive/2011/05/30/2061370.html 1.Service的种类   按运行地点分类: 类别 区别  优点 ...

  6. Android adb常见问题整理(转)

    原文地址:http://blog.csdn.net/androiddevelop/article/details/8130416 以下都是ADB连接问题,可以通过尝试如下步骤,由简单度排序 1. 插拔 ...

  7. (转)Mysql数据库读写分离配置

    环境模拟 实现读写分离 减轻数据库的负荷 主服务器 master 10.0.0.12从服务器 slave 10.0.0.66 ------------------------------------- ...

  8. 项目中的那些事---PHP函数

    总结工作中遇到的php函数: 1.查找:strpos("str", "substr"): 查找substr字符串在str字符串中出现的位置 第一个参数是:被查找 ...

  9. vs工程链接出现error LNK2005...already defined

    今天使用vs2008编译工程无错误,链接过程,出现很多这样的错误: error LNK2005: "public: __thiscall std::basic_string<char, ...

  10. Linux 小记录

    <1>bzero 原型:extern void bzero(void *s, int n);用法:#include <string.h> 功能:置字节字符串s的前n个字节为零. ...