Score:1

Ubuntu 20.04 "NO LanMan password set for user"

de flag

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?

Score:1
es flag

I think you are almost there.

Your HP printer is trying to connect to the Ubuntu server using the SMB1 ( Samba calls it NT1 ) dialect of smb. In Ubuntu 16 or 18 that wasn't a problem. In Ubuntu 20 Samba turned it off by default.

You can enable it in Ubuntu 20 by editing smb.conf and under the workgroup = WORKGROUP line add this one:

server min protocol = NT1

You can try to restart smbd sudo service smbd restart but you may have to just reboot.

Bil_Bomba avatar
de flag
I added "server min protocol = NT1" to the global section of smb.conf and then set the password with smbpasswd, but its still not working. The log still says "No LanMan password set"
Score:0
de flag

Finally solved it:

[global]
   server min protocol = NT1
   ntlm auth = yes
   lanman auth = yes

and setting a new password by

sudo smbpasswd username

solved it as suggested by Morbius1.

But I had two more things to consider:

  1. Setting the same password as it was before wont reset the hash.
  2. The passwords maximal length is 14 character. With longer passwords the hash will not be set.

The hash can be checked with

pdbedit -L -W

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX stands for not set.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.