在使用Samba进行建立Window与Linux共享时,要是不能访问,出现“您可能没有权限使用网络资源”,
那就是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 linux windows 请联系管理员的更多相关文章

  1. 【转帖】Linux上搭建Samba,实现windows与Linux文件数据同步

    Linux上搭建Samba,实现windows与Linux文件数据同步 2018年06月09日 :: m_nanle_xiaobudiu 阅读数 15812更多 分类专栏: Linux Samba 版 ...

  2. How To Configure SAMBA Server And Transfer Files Between Linux & Windows

    If you are reading this article it means you have a network at home or office with Windows and Linux ...

  3. windows 映射samba Linux服务器,输入正确的账号密码却提示“ 指定的网络密码不正确

    重启Linux samba服务也没用,重启Linux和windows系统也没用,急!!! 最佳答案 linux中要添加对应的系统用户和samba用户useradd titiansmbpasswd -a ...

  4. linux/windows下启用和停止VMware后台服务的脚本

    linux/windows下启用和停止VMware后台服务的脚本 linux/windows下启用和停止VMware后台服务的脚本 linux平台 windows平台 本文由乌合之众 lym瞎编,欢迎 ...

  5. Linux 与 Linux Windows 文件共享 小知识

    Linux 与 Linux Windows 文件共享   前提说明:windows主机信息:192.168.1.100 帐号:abc 密码:123 共享文件夹:sharelinux主机信息:192.1 ...

  6. 使用VS Code配合Remote Development插件连接远程服务器(Mac/Linux+Windows) | Using VS Code with Remote Development Connect to Remote Server (Mac/Linux+Windows)

    最新版VS Code(2019年6月)出了一系列新的插件,包括Remote Development,Remote SSH等,使得用户可以使用VS Code远程连接服务器写代码,方便了协同工作.具体配置 ...

  7. Linux / Windows应用方案不完全对照表

    Linux/Windows应用方案不完全对照表 650) this.width=650;" border="0" src="http://img1.51cto. ...

  8. mouse scrollings and zooming operations in linux & windows are opposite

    mouse scrollings and zooming operations in linux & windows are opposite. windows中, 鼠标滚动的方向是: 查看页 ...

  9. 在Mac/Linux/Windows上编译corefx遇到的问题及解决方法

    这两天尝试在Mac/Linux/Windows三大平台上编译.NET跨平台三驾马车(coreclr/corefx/dnx)之一的corefx(.NET Core Framework),结果三个平台的编 ...

随机推荐

  1. 4554: [Tjoi2016&Heoi2016]游戏 二分图匹配

    题目链接: http://www.lydsy.com/JudgeOnline/problem.php?id=4554 题解: 如果没有硬石头的话,就是’*‘点对应的行列建边,然后跑最大匹配 硬石头什么 ...

  2. bzoj 1015 并查集

    逆向思维,先将整张图以最后所有要求的点毁掉的状态建图,然后倒着 加点就行了,用并查集维护连通块 /*************************************************** ...

  3. shell编程之echo命令

    Linux echo命令不能显示文件中的内容.显示字符串或者变量功能说明:显示文字.语 法:echo [-ne][字符串]或 echo [--help][--version]补充说明:echo会将输入 ...

  4. 对话机器学习大神Yoshua Bengio(上)

    Yoshua Bengio教授(个人主页)是机器学习大神之一,尤其是在深度学习这个领域.他连同Geoff Hinton老先生以及 Yann LeCun(燕乐存)教授,缔造了2006年开始的深度学习复兴 ...

  5. .NET设计模式(13):享元模式(Flyweight Pattern)(转)

    摘要:面向对象的思想很好地解决了抽象性的问题,一般也不会出现性能上的问题.但是在某些情况下,对象的数量可能会太多,从而导致了运行时的代价.那么我们如何去避免大量细粒度的对象,同时又不影响客户程序使用面 ...

  6. PHP第一课:开发环境配置

    最近在学php,大概了解了一下php的语法结构,以及一些php及基础的知识.由此想到了要亲手试一试:以为以前是学java的用的  ide是myeclipse,所以对eclipse软件布局有特别的钟爱. ...

  7. AESEncrypter加密算法代码示例

    package testJava.java; import java.security.SecureRandom; import java.util.Base64; import javax.cryp ...

  8. ECMAScript 5.1中对属性的操作

    此操作只针对新版本浏览器. Object.defineProperty(obj,'name',{configurable:true/false,enumberable:true/false,value ...

  9. php7 安装 及和php5的共存

    http://blog.csdn.net/liuxinmingcode/article/details/50319145 LNMP FastCGI 是一个可伸缩地.高速地在HTTP server和动态 ...

  10. iOS第三方推送-极光推送

    @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...