我在 Ubuntu 20.04 机器上将一个 USB 驱动器安装到 /media/usbdrive。我可以将文件写入除根共享之外的任何共享。这意味着,我将这些共享设置在smb.conf:
[usb]
path = /media/usbdrive
valid users = @samba
force user = shareuser
writable = yes
read only = no
browseable = yes
[apps]
path = /media/usbdrive/Apps
valid users = @samba
force user = shareuser
writable = yes
read only = no
browseable = yes
[music]
path = /media/usbdrive/Music/MP3
valid users = @samba
force user = shareuser
writable = yes
read only = no
browseable = yes
在 Windows 10 (192.168.0.229) 中,我可以通过提供 的密码来访问共享shareuser
。然后我可以将文件写入apps
和music
共享中的任何目录,但不能- 我收到“访问被拒绝”错误。当通过和共享访问时,可以写入通过usb
无法访问的相同目录。usb
apps
music
有什么想法吗?我尝试过让 /media/usbdrive 目录拥有不同的所有者,但似乎没有帮助(但也许我遗漏了一些东西)。
drwxrwxrwx+ 11 root samba 4096 Apr 9 12:07 usbdrive
$ sudo smbstatus
Samba version 4.11.6-Ubuntu
PID Username Group Machine Protocol Version Encryption Signing
----------------------------------------------------------------------------------------------------------------------------------------
3682 shareuser shareuser 192.168.0.229 (ipv4:192.168.0.229:52277) SMB3_11 - partial(AES-128-CMAC)
Service pid Machine Connected at Encryption Signing
---------------------------------------------------------------------------------------------
usb 3682 192.168.0.229 Sun May 10 02:19:18 PM 2020 PDT - -
apps 3682 192.168.0.229 Sun May 10 02:21:40 PM 2020 PDT - -
music 3682 192.168.0.229 Sun May 10 02:19:18 PM 2020 PDT - -
Locked files:
Pid User(ID) DenyMode Access R/W Oplock SharePath Name Time
--------------------------------------------------------------------------------------------------
3682 1001 DENY_NONE 0x80 RDONLY NONE /media/usbdrive . Sun May 10 14:19:18 2020
3682 1001 DENY_NONE 0x80 RDONLY NONE /media/usbdrive/Music/MP3 . Sun May 10 14:19:18 2020
3682 1001 DENY_NONE 0x100081 RDONLY NONE /media/usbdrive/Apps . Sun May 10 14:22:00 2020
3682 1001 DENY_NONE 0x100081 RDONLY NONE /media/usbdrive/Apps . Sun May 10 14:22:15 2020
3682 1001 DENY_NONE 0x100081 RDONLY NONE /media/usbdrive/Apps . Sun May 10 14:22:25 2020