在centos上运行samba。 设置一些股票,并有一个奇怪的问题。 对于两个不同的共享同样的configuration,我可以访问1但不是其他的。
[test2] path = /usr/test2 writeable = no browsable = yes guest ok = yes guest only = yes public = yes read only = yes printable = no [layout_runtime] path = /u/layout/runtime writeable = no browsable = yes guest ok = yes guest only = yes public = yes read only = yes printable = no
权限:
drwxrwxrwx. 17 root nobody 4.0K Sep 21 09:27 u drwxrwxrwx. 12 root nobody 4.0K Aug 30 15:43 layout drwxrwxrwx. 2 root nobody 6 Sep 23 13:24 test2
/ u在单独的一组驱动器上。 这是唯一的区别。
/dev/mapper/centos-root / xfs defaults 0 0 UUID=0caacd23-f24f-4423-b33a-6b950385fe1a /boot xfs defaults 0 0 /dev/mapper/centos-swap swap swap defaults 0 0 /dev/disk/by-uuid/5b0cdb1d-53d4-4ec0-b5ab-111be8c77ec5 /u auto nosuid,nodev,nofail,x-gvfs-show 0 0
尝试访问来自win的layout_runtime共享我得到“你没有权限。无效的句柄”
日志没有显示任何我可以看到的:
[2016/09/23 15:06:27.746849, 2] ../source3/smbd/service.c:862(make_connection_snum) bmarkeyyoga (ipv4:192.168.206.184:50101) connect to service test2 initially as user nobody (uid=99, gid=99) (pid 21898) [2016/09/23 15:06:35.547660, 2] ../source3/smbd/service.c:862(make_connection_snum) bmarkeyyoga (ipv4:192.168.206.184:50101) connect to service layout_runtime initially as user nobody (uid=99, gid=99) (pid 21898)
除此之外,没有特别的configuration选项:
unix extensions = no guest account = nobody log level = 2
Testparm很好:
Load smb config files from /etc/samba/smb.conf rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) Processing section "[kindle]" Processing section "[test]" Processing section "[test2]" Processing section "[layout_runtime]" Loaded services file OK. WARNING: You have some share names that are longer than 12 characters. These may not be accessible to some older clients. (Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.) Server role: ROLE_STANDALONE
这显然是一个SELinux的东西。
chcon -t samba_share_t <share_folder>
修复。