Permissions

NT_STATUS_ACCESS_DENIED 列表 * - Samba 伺服器

  • October 29, 2018

我正在嘗試設置 CentOS 7 samba 伺服器,但我無法使某些權限起作用。

我所有的文件和目錄只允許它們各自的所有者使用,例如:

drwxrwx---.  5 root setcob        4.0K Feb 12  2016 setcob
drwxrwx---+  7 root setorpessoal  4.0K Oct 25 19:30 setorpessoal

但是當我通過 smbclient 連接時,我無法在setorpessoal中使用**ls

smb.conf:

[global]
       workgroup = workgroup
       netbios name = sambaserver
       netbios aliases = sambaserver
       server string = sambaserver
       map to guest = Bad User
       passdb backend = smbpasswd
       log level = 4
       log file = /var/log/samba/%U.log
       max log size = 1000
       max xmit = 65535
       deadtime = 15
       socket options = TCP_NODELAY IPTOS_LOWDELAY
       os level = 100
       preferred master = Yes
       domain master = Yes
       dns proxy = No
       wins support = Yes
       full_audit:prefix = %u|%i|%S
       recycle:keeptree = yes
       recycle:versions = yes
       recycle:repository = /mnt/samba/lixeira
       recycle:exclude = *.tmp, *.log, *.obj, ~*.*, *.bak, *.iso
       recycle:exclude_dir = tmp, cache
       invalid users = root
       admin users = user1, user2, user3
       write list = user1, user2, user3
       veto files = /~*/
       hide files = /~*/
       vfs objects = recycle

[setorpessoal]
       comment = Setor Pessoal
       path = /mnt/samba/setorpessoal
       valid users = @setorpessoal, setorpessoal, user1, user2, user3
       read only = No
       force create mode = 0777
       force directory mode = 0777
       write cache size = 384000
       veto files = /*.mp3/*.wav/*.tif/*.pif/
       recycle:keeptree = yes
       recycle:versions = yes
       recycle:repository = lixeira
       recycle:exclude = *.tmp, *.log, *.obj, ~*.*, *.bak, *.iso
       recycle:exclude_dir = tmp

日誌錯誤:

[2018/10/26 17:41:52.458256,  3] ../source3/smbd/service.c:120(set_current_service)
 chdir (/mnt/samba_novo/samba/setorpessoal) failed, reason: Permission denied
[2018/10/26 17:41:52.458296,  3] ../source3/smbd/smb2_server.c:3120(smbd_smb2_request_error_ex)
 smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../source3/smbd/smb2_server.c:2472

我正在使用帶有 Samba 4.7.1 的 CentOS 7。

好的,我發現了問題:我沒有將我的新權限設置為其根目錄。所有文件夾都正常,但*/mnt/mnt/samba*屬於root。我設置為 777。順便說一句,我還禁用了 SElinux。

引用自:https://serverfault.com/questions/937450