Samba 共享文件後在Windows 上沒法訪問的問題

/etc/samba/smb.conf的配置以下:windows

#============================ 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服務器而且可以看到共享文件夾,可是沒法進入該文件夾,以下:spa

解決方法:(該方法在/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

因此執行以上命令:3d

#chcon -t samba_share_t /path/to/directory

便可解決問題code

相關文章
相關標籤/搜索