Samba - 可以访问 1 个共享,但不能访问另一个共享。配置相同

Samba - 可以访问 1 个共享,但不能访问另一个共享。配置相同

在 centos 上运行 samba。设置一些共享并遇到一个奇怪的问题。两个不同的共享具有相同的配置,我可以访问其中一个,但不能访问另一个。

[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)

除这些之外没有特殊配置选项:

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

答案1

显然这是 SELinux 的事情。

chcon -t samba_share_t <share_folder>

修复。

相关内容