我最近在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. 【解决】该任务映像已损坏或已篡改。(异常来自HRESULT:0x80041321)

    把系统升级到Windows 10,体验了一番Windows 10.感觉不怎么好用退回到了Windows 7,发现我原来自定义的任务计划没有按时执行,于是打开任务计划,弹出了下面的对话框[该任务映像已损 ...

  2. Jersey(1.19.1) - Building URIs

    A very important aspects of REST is hyperlinks, URIs, in representations that clients can use to tra ...

  3. Quartz Scheduler(2.2.1) - Usage of SimpleTrigger

    SimpleTrigger should meet your scheduling needs if you need to have a job execute exactly once at a ...

  4. Git CMD - checkout: Switch branches or restore working tree files

    命令格式 git checkout [-q] [-f] [-m] [<branch>] git checkout [-q] [-f] [-m] --detach [<branch&g ...

  5. 省市数据递归加载到TreeView

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  6. 第五十三篇、OC利用AFN上传视频到服务器

    整体思路已经清楚,拿到视频资源,先转为mp4,写进沙盒,然后上传,上传成功后删除沙盒中的文件. 本地拍摄的视频,上传到服务器: //视频转换为MP4 //转码操作... _hud.mode = MBP ...

  7. iMAC——关闭自动弹出手机照片

    有时当自己的iPhone手机插入一台iMAC电脑时,会自动弹出自己iPhone手机的照片. 这相当影响人的隐私等等,所以顺便将方法(参考网络的)小记一篇博客. 一.OS X 10.10以上用户解决办法 ...

  8. [Bootstrap]全局样式(二)

    具体排版 1.标题和标题类 <h1> ~<h6>和.h1~h6|副标题<small>和.small font-size                    mar ...

  9. MySQL忘记密码后重置密码(Mac )

    安装好MySQL以后,系统给了个默认的的密码,然后说如果忘记了默认的密码......我复制了默认密码就走过了这一步,这一步就是我漫长旅程的开始.他给的密码太复杂了,当然我得换一个,而且我还要假装我不记 ...

  10. Kubernetes Architecture

    reference:https://www.symantec.com/connect/blogs/google-kubernetes-analytical-evaluation