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

即可解決問題


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM