OpenMediaVault SMB/CIFS配置完成之后,打开某些目录提示错误"找不到链接",其他目录正常。
修改配置文件"/etc/samba/smb.conf"中的"log level = 3",然后观察日志"tail -f /var/log/syslog",
观察到如下日志输出:
1 2 3 4 5 6 7 8 9 10 11 12 |
Aug 31 23:54:34 openmediavault smbd[2389]: [2019/08/31 23:54:34.006550, 3] ../source3/smbd/service.c:102(set_current_service) Aug 31 23:54:34 openmediavault smbd[2389]: chdir (/media/6357625f-xxxx-xxxx-xxxx-xxxxxxxxxxxx/MyCloud) failed, reason: 权限不够 Aug 31 23:54:34 openmediavault smbd[2389]: [2019/08/31 23:54:34.006667, 3] ../source3/smbd/smb2_server.c:3097(smbd_smb2_request_error_ex) Aug 31 23:54:34 openmediavault smbd[2389]: smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../source3/smbd/smb2_server.c:2449 Aug 31 23:54:34 openmediavault smbd[2389]: [2019/08/31 23:54:34.012733, 3] ../source3/smbd/service.c:1098(close_cnum) Aug 31 23:54:34 openmediavault smbd[2389]: longskys-mbp (ipv4:10.10.10.116:54656) closed connection to service IPC$ Aug 31 23:54:34 openmediavault smbd[2389]: [2019/08/31 23:54:34.014028, 3] ../source3/smbd/service.c:102(set_current_service) Aug 31 23:54:34 openmediavault smbd[2389]: chdir (/media/6357625f-xxxx-xxxx-xxxx-xxxxxxxxxxxx/MyCloud) failed, reason: 权限不够 Aug 31 23:54:34 openmediavault smbd[2389]: [2019/08/31 23:54:34.014151, 3] ../source3/smbd/smb2_server.c:3097(smbd_smb2_request_error_ex) Aug 31 23:54:34 openmediavault smbd[2389]: smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../source3/smbd/smb2_server.c:2449 Aug 31 23:54:34 openmediavault smbd[2389]: [2019/08/31 23:54:34.017951, 2] ../source3/smbd/service.c:1098(close_cnum) Aug 31 23:54:34 openmediavault smbd[2389]: longskys-mbp (ipv4:10.10.10.116:54656) closed connection to service MainBackup |
不管如何修改,都搞不定,观察目录权限以及所有者信息,如下:
1 2 3 4 5 6 7 8 9 |
root@openmediavault:~# ls -la /media/ 总用量 20 drwxr-xr-x 6 root root 4096 8月 25 00:03 . drwxr-xr-x 24 root root 4096 8月 30 23:23 .. drwxrwx--- 1 root 1000 164 6月 2 14:37 6357625f-xxxx-xxxx-xxxx-xxxxxxxxxxxx drwxrwsr-x+ 4 root users 4096 8月 15 2017 9b5fcef5-xxxx-xxxx-xxxx-xxxxxxxxxxxx drwxr-xr-x 2 root root 4096 5月 26 2015 cdrom lrwxrwxrwx 1 root root 4 5月 26 2015 usb -> usb0 drwxr-xr-x 2 root root 4096 5月 26 2015 usb0 |
观察到正常的目录的权限是 root:users 而不正常的目录权限是 root:1000,于是执行权限修改,如下:
1 2 3 4 5 6 7 8 9 10 |
root@openmediavault:~# sudo chown root:users /media/6357625f-xxxx-xxxx-xxxx-xxxxxxxxxxxx/ root@openmediavault:~# ls -la /media/ 总用量 20 drwxr-xr-x 6 root root 4096 8月 25 00:03 . drwxr-xr-x 24 root root 4096 8月 30 23:23 .. drwxrwx--- 1 root users 164 6月 2 14:37 6357625f-xxxx-xxxx-xxxx-xxxxxxxxxxxx drwxrwsr-x+ 4 root users 4096 8月 15 2017 9b5fcef5-xxxx-xxxx-xxxx-xxxxxxxxxxxx drwxr-xr-x 2 root root 4096 5月 26 2015 cdrom lrwxrwxrwx 1 root root 4 5月 26 2015 usb -> usb0 drwxr-xr-x 2 root root 4096 5月 26 2015 usb0 |
之后就可以正常访问了。