我将一台机器从 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 中。我还应该去哪里看?
回答我自己的问题:smbpasswd -a vdr解决了我的问题。与 Samba 4.2 相比,Samba 4.5 似乎变得更加严格。