我将一台机器从 Debian Jessie 更新到 Stretch,同时将 Samba 版本从 4.2.14 升级到 4.5.16。我可以挂载 Samba 共享,浏览和读取它,但是当我尝试写入某些内容时,权限被拒绝。
我的 smb.conf 看起来像这样并且在 Samba 4.2.14 上运行良好:
[global]
workgroup = video
server string = %h server (Samba %v)
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
panic action = /usr/share/samba/panic-action %d
obey pam restrictions = yes
invalid users = root
security = user
map to guest = Bad User
os level = 33
socket options = TCP_NODELAY
unix charset = UTF-8
strict allocate = yes
log level = 3
[backup]
comment = backup
path = /mnt/backup
writeable = yes
public = yes
force user = vdr
read only = no
guest ok = yes
我在 Samba 日志中发现以下内容:
[2020/07/15 09:55:06.621634, 3] ../source3/auth/auth.c:178(auth_check_ntlm_password)
check_ntlm_password: Checking password for unmapped user []\[vdr]@[] with the new password interface
[2020/07/15 09:55:06.621717, 3] ../source3/auth/auth.c:181(auth_check_ntlm_password)
check_ntlm_password: mapped user is: [VDR]\[vdr]@[]
[2020/07/15 09:55:06.621865, 3] ../source3/auth/check_samsec.c:400(check_sam_security)
check_sam_security: Couldn't find user 'vdr' in passdb.
[2020/07/15 09:55:06.621922, 2] ../source3/auth/auth.c:315(auth_check_ntlm_password)
check_ntlm_password: Authentication for user [vdr] -> [vdr] FAILED with error NT_STATUS_NO_SUCH_USER
[2020/07/15 09:55:06.622054, 3] ../source3/auth/auth_util.c:1611(do_map_to_guest_server_info)
No such user vdr [] - using guest account
用户 vdr 存在于 /etc/samba/smbpasswd 中。我还应该在哪里查找?
答案1
回答我自己的问题:smbpasswd -a vdr解决了我的问题。看来 Samba 4.5 比 Samba 4.2 更加严格了。