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

相关文章
相关标签/搜索