红联Linux门户
Linux帮助

Samba共享文件后在Windows上无法访问的问题

发布时间:2016-04-28 09:53:59来源:linux网站作者:牛逼闪闪

/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服务器并且能够看到共享文件夹,但是无法进入该文件夹,如下:

Samba共享文件后在Windows上无法访问的问题


解决方法:(该方法在/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

即可解决问题。


本文永久更新地址:http://www.linuxdiyf.com/linux/20153.html