无法使 samba 共享可写

无法使 samba 共享可写

我正在尝试使我的 samba 共享(在 Debian 10 上运行)可写,但似乎我尝试的任何操作都会破坏共享,并且我无法再访问它。

这是我当前的配置:

[MediaServer4TB]
   comment = Media Server 4TB
   browseable = yes
   path = /media/sf_filesrvr
   guest ok = no
   read only = no
   create mask = 0600
   directory mask = 0700
   security = user
   encrypt passwords = yes
   force user = root
   writeable = yes

客户端是 Ubuntu 20.04 LTS 机器。

问题可能是该计算机是使用虚拟文件夹作为共享目录的虚拟机吗?如果是,您将如何进行?

编辑:我意识到我可以从远程计算机复制文件和文件夹,但无法在 samba 共享内移动文件。该目录/media/sf_filesrvr可由 root(尝试访问它的用户)写入

以下是特定客户端的日志输出:

[2022/05/01 15:33:49.864251,  3] ../../auth/ntlmssp/ntlmssp_sign.c:623(ntlmssp_sign_reset)
  NTLMSSP Sign/Seal - Initialising with flags:
[2022/05/01 15:33:49.864280,  3] ../../auth/ntlmssp/ntlmssp_util.c:72(debug_ntlmssp_flags)
  Got NTLMSSP neg_flags=0x62088215
[2022/05/01 15:33:49.864331,  3] ../../auth/ntlmssp/ntlmssp_sign.c:623(ntlmssp_sign_reset)
  NTLMSSP Sign/Seal - Initialising with flags:
[2022/05/01 15:33:49.864352,  3] ../../auth/ntlmssp/ntlmssp_util.c:72(debug_ntlmssp_flags)
  Got NTLMSSP neg_flags=0x62088215
[2022/05/01 15:33:49.864612,  3] ../../source3/auth/token_util.c:688(finalize_local_nt_token)
  Failed to fetch domain sid for WORKGROUP
[2022/05/01 15:33:49.865078,  3] ../../source3/groupdb/mapping.c:854(pdb_create_builtin_alias)
  pdb_create_builtin_alias: Could not get a gid out of winbind
[2022/05/01 15:33:49.865115,  2] ../../source3/auth/token_util.c:719(finalize_local_nt_token)
  WARNING: Failed to create BUILTIN\Administrators group!  Can Winbind allocate gids?
[2022/05/01 15:33:49.865611,  3] ../../source3/groupdb/mapping.c:854(pdb_create_builtin_alias)
  pdb_create_builtin_alias: Could not get a gid out of winbind
[2022/05/01 15:33:49.865647,  2] ../../source3/auth/token_util.c:739(finalize_local_nt_token)
  WARNING: Failed to create BUILTIN\Users group! Can Winbind allocate gids?
[2022/05/01 15:33:49.866176,  3] ../../source3/groupdb/mapping.c:854(pdb_create_builtin_alias)
  pdb_create_builtin_alias: Could not get a gid out of winbind
[2022/05/01 15:33:50.008196,  3] ../../source3/smbd/password.c:84(register_homes_share)
  Adding homes service for user 'root' using home directory: '/root'

答案1

如果您可以使用用户/密码对正确安装共享,并且您能够从远程客户端读取共享的内容,但无法写入共享,则此 awnser 解决了该问题。

/etc/samba/smb.conf当然,您需要这样的部分:

[BobsVolume]
comment = BobsVolume
path = /mnt/BobsVolume
create mask = 0600
directory mask = 0700
read only=No
guest ok=No
valid users = bob

最重要的参数是read only=novalid userwriteable=yes是同义词。

好吧,在我看来,互联网上没有人的答案包含解决问题的关键,那就是:您的共享必须由您的系统拥有smbuser:smbgroup

如果您使用的是 docker 镜像dperson/samba,请不要忘记运行

chown smbuser:smb /mnt/BobsVolume

在这个例子中。

相关内容