zoukankan      html  css  js  c++  java
  • Samba 共享文件后在Windows 上无法访问的问题

    /etc/samba/smb.conf的配置如下:

    #============================ Share Definitions ==============================
    
    [homes]
            comment = Home Directories
            browseable = no
            writable = yes
            valid users = %S
            valid users = MYDOMAIN\%S
    
    [printers]
            comment = All Printers
            path = /var/spool/samba
            browseable = no
            guest ok = no
            writable = no
            printable = yes
    
    [Downloads]
        public = yes
            comment = Share with windows
            path = /home/leng/Downloads
            browseable = yes
            guest ok = yes
            writable = yes

    在命令行添加可访问的用户

    # smbpasswd -a leng

    输入密码后在windows上访问,发现可以登陆到samba服务器并且能够看到共享文件夹,但是无法进入该文件夹,如下:

    解决方法:(该方法在/etc/samba/smb.conf中有提到)

    # Set SELinux labels only on files and directories you have created. Use the
    # chcon command to temporarily change a label:
    # chcon -t samba_share_t /path/to/directory

    所以执行以上命令:

    #chcon -t samba_share_t /path/to/directory

    即可解决问题

  • 相关阅读:
    053403
    053402
    053401
    053400
    053399
    053398
    053397
    053396
    053395
    第k小数
  • 原文地址:https://www.cnblogs.com/dreamyphone/p/4507985.html
Copyright © 2011-2022 走看看