zoukankan      html  css  js  c++  java
  • Samba出现“您可能没有权限使用网络资源”解决方法

    我最近在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
    #
    #--------------
    #

  • 相关阅读:
    JAVA-初步认识-第五章-数组-常见操作-最值2
    JAVA-初步认识-第五章-数组-常见操作-最值
    JAVA-初步认识-第五章-数组-常见操作-遍历
    JAVA-初步认识-第五章-数组-第二种定义格式
    JAVA-初步认识-第四章-数组-常见问题
    JAVA-初步认识-第四章-内存图解
    日期加1程序
    发生了COMException 异常来自 HRESULT:0x80040228
    设置窗体的可见性无效
    DotNetBar RibbonControl 控件动态添加项
  • 原文地址:https://www.cnblogs.com/phpeye/p/3274782.html
Copyright © 2011-2022 走看看