在使用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 # #-------------- #

最新文章

  1. 读书笔记--SQL必知必会16--更新和删除数据
  2. java类初始化顺序
  3. SQL Server 2012 各版本功能比较
  4. ios如何生成crash报告
  5. 快速用springmvc搭建web应用-超越昨天的自己系列(10)
  6. Linux性能检测命令 - vmstat
  7. Oracle取得中文拼音首字母函数
  8. Xml通用操作类
  9. 射频识别技术漫谈(9)——动物标签HDX
  10. VMware仅主机模式虚拟机无法ping通物理机
  11. windows 查看端口被哪个程序占用
  12. 用js来实现那些数据结构07(链表01-链表的实现)
  13. Win10 中将网页转换成pdf的简便方法
  14. linux下apt安装mysql导致mysql.user table is damaged
  15. window.name跨域实现
  16. Linux-(ls,mv,mkdir,rm,cp)
  17. 匿名内部类中关于new Runnable()的使用
  18. CSS学习笔记(6)--浮动,三列布局,高度宽度自适应
  19. 【跟着stackoverflow学Pandas】add one row in a pandas.DataFrame -DataFrame添加行
  20. SS配置出错解决方法

热门文章

  1. xml给提示
  2. Codeforces Round #278 (Div. 2)
  3. color mask
  4. mongodb 主从服务器
  5. ios frame、bound和center定义及使用场景总结
  6. CSS Ruler 前端工具
  7. POJ 1631
  8. Javascript 正则表达式笔记2
  9. poj 1511(SPFA+邻接表)
  10. 使用datatable 将测试数据与业务分离