My setup:
Server with Ubuntu 20.04 with samba shares.
HP Deskjet 8620 Pro printer.
The printer provides a feature called "Scan to network folder". It used to work with Ubuntu 16.04, but it does not since the update. Googling i found that this printer is using a very old protocol version of smb.
I found this post which suggests setting
[global]
ntlm auth = yes
lanman auth = yes
in smb.conf.
After adding those two lines i restarted samba and changed the password of the corresponding smb user:
sudo systemctl restart smbd.server nmbd.service
sudo smbpasswd hpscanner
Samba debug log still tells me "NO LanMan password set for user hpscanner":
[2021/06/06 19:37:36.401815, 3] ../../source3/auth/auth.c:199(auth_check_ntlm_password)
check_ntlm_password: Checking password for unmapped user [SERVER]\[hpscanner]@[WORKSTATION] with the new password interface
[2021/06/06 19:37:36.401828, 3] ../../source3/auth/auth.c:202(auth_check_ntlm_password)
check_ntlm_password: mapped user is: [SERVER]\[hpscanner]@[WORKSTATION]
[2021/06/06 19:37:36.402019, 3] ../../source3/passdb/lookup_sid.c:1684(get_primary_group_sid)
Forcing Primary Group to 'Domain Users' for hpscanner
[2021/06/06 19:37:36.402147, 3] ../../libcli/auth/ntlm_check.c:403(ntlm_password_check)
ntlm_password_check: NTLMv2 password check failed
[2021/06/06 19:37:36.402163, 3] ../../libcli/auth/ntlm_check.c:451(ntlm_password_check)
ntlm_password_check: NO LanMan password set for user hpscanner (and no NT password supplied)
[2021/06/06 19:37:36.402215, 3] ../../libcli/auth/ntlm_check.c:593(ntlm_password_check)
ntlm_password_check: LM password, NT MD4 password in LM field and LMv2 failed for user hpscanner
[2021/06/06 19:37:36.402394, 2] ../../source3/auth/auth.c:343(auth_check_ntlm_password)
check_ntlm_password: Authentication for user [hpscanner] -> [hpscanner] FAILED with error NT_STATUS_WRONG_PASSWORD, authoritative=1
supplied)
So how do I set the LanMan password correctly?
Can I configure samba to except this old authentication only for this one user?
Thanks!
Edit:
I Added
server min protocol = NT1
as suggested in the answers. This did not change anything.
log:
[2021/08/05 19:51:46.005653, 3] ../../source3/auth/auth.c:199(auth_check_ntlm_password)
check_ntlm_password: Checking password for unmapped user [SERVER]\[hpscanner]@[WORKSTATION] with the new password interface
[2021/08/05 19:51:46.005665, 3] ../../source3/auth/auth.c:202(auth_check_ntlm_password)
check_ntlm_password: mapped user is: [SERVER]\[hpscanner]@[WORKSTATION]
[2021/08/05 19:51:46.005848, 3] ../../source3/passdb/lookup_sid.c:1684(get_primary_group_sid)
Forcing Primary Group to 'Domain Users' for hpscanner
[2021/08/05 19:51:46.005967, 3] ../../libcli/auth/ntlm_check.c:403(ntlm_password_check)
ntlm_password_check: NTLMv2 password check failed
[2021/08/05 19:51:46.005982, 3] ../../libcli/auth/ntlm_check.c:451(ntlm_password_check)
ntlm_password_check: NO LanMan password set for user hpscanner (and no NT password supplied)
[2021/08/05 19:51:46.006036, 3] ../../libcli/auth/ntlm_check.c:593(ntlm_password_check)
ntlm_password_check: LM password, NT MD4 password in LM field and LMv2 failed for user hpscanner
[2021/08/05 19:51:46.006198, 2] ../../source3/auth/auth.c:343(auth_check_ntlm_password)
check_ntlm_password: Authentication for user [hpscanner] -> [hpscanner] FAILED with error NT_STATUS_WRONG_PASSWORD, authoritative=1
[2021/08/05 19:51:46.006239, 2] ../../auth/auth_log.c:635(log_authentication_event_human_readable)
Auth: [SMB,(null)] user [SERVER]\[hpscanner] at [Thu, 05 Aug 2021 19:51:46.006227 UTC] with [NTLMv2] status [NT_STATUS_WRONG_PASSWORD] workstation [WORKSTATION] remote host [ipv4:10.0.0.210:1024] mapped to [SERVER]\[hpscanner]. local host [ipv4:10.0.0.200:445]
{"timestamp": "2021-08-05T19:51:46.006293+0000", "type": "Authentication", "Authentication": {"version": {"major": 1, "minor": 2}, "eventId": 4625, "logonId": "0", "logonType": 3, "status": "NT_STATUS_WRONG_PASSWORD", "localAddress": "ipv4:10.0.0.200:445", "remoteAddress": "ipv4:10.0.0.210:1024", "serviceDescription": "SMB", "authDescription": null, "clientDomain": "SERVER", "clientAccount": "hpscanner", "workstation": "WORKSTATION", "becameAccount": null, "becameDomain": null, "becameSid": null, "mappedAccount": "hpscanner", "mappedDomain": "SERVER", "netlogonComputer": null, "netlogonTrustAccount": null, "netlogonNegotiateFlags": "0x00000000", "netlogonSecureChannelType": 0, "netlogonTrustAccountSid": null, "passwordType": "NTLMv2", "duration": 5104}}
[2021/08/05 19:51:46.006332, 3] ../../auth/gensec/spnego.c:1442(gensec_spnego_server_negTokenTarg_step)
gensec_spnego_server_negTokenTarg_step: SPNEGO(ntlmssp) login failed: NT_STATUS_WRONG_PASSWORD
[2021/08/05 19:51:46.006368, 3] ../../source3/smbd/error.c:78(error_packet_set)
NT error packet at ../../source3/smbd/sesssetup.c(246) cmd=115 (SMBsesssetupX) NT_STATUS_LOGON_FAILURE
[2021/08/05 19:51:46.007110, 3] ../../source3/smbd/server_exit.c:243(exit_server_common)
Server exit (failed to receive smb request)
any ideas?