net usersidlist command did not show new user

jasonca

Dabbler
Joined
Dec 2, 2021
Messages
19
Today I found that the new user could not access the shared folder, I checked with “net usersidlist” and found no new user in the list


the logfile auth_audit.log

{"timestamp": "2021-12-02T15:09:59.274993-0800", "type": "Authentication", "Authentication": {"version": {"major": 1, "minor": 2}, "eventId": 4625, "logonId": "0", "logonType": 3, "status": "NT_STATUS_NO_SUCH_USER", "localAddress": "ipv4:192.168.3.99:445", "remoteAddress": "ipv4:192.168.3.106:50017", "serviceDescription": "SMB2", "authDescription": null, "clientDomain": "DESKTOP-F7B2KJ4", "clientAccount": "Laura", "workstation": "DESKTOP-F7B2KJ4", "becameAccount": null, "becameDomain": null, "becameSid": null, "mappedAccount": "Laura", "mappedDomain": "DESKTOP-F7B2KJ4", "netlogonComputer": null, "netlogonTrustAccount": null, "netlogonNegotiateFlags": "0x00000000", "netlogonSecureChannelType": 0, "netlogonTrustAccountSid": null, "passwordType": "NTLMv2", "duration": 1710}}


All other old users are working.
 

jasonca

Dabbler
Joined
Dec 2, 2021
Messages
19
I fixed it.

1) service samba_server stop
2) mv /var/db/system/samba4/account_policy.tdb /var/db/system/samba4/account_policy.tdb.bak
3) service samba_server start
4) delete the account Laura, and create new account laura
5) check "net usersidlist", find the account laura
6) check share folder from windows. it is working.
 

jasonca

Dabbler
Joined
Dec 2, 2021
Messages
19
It is very strange, I create a new account test, and then check the net usersidlist , but there is still no test account.
 

jasonca

Dabbler
Joined
Dec 2, 2021
Messages
19
I added one more user, test1, and then check net usersidlist, it show test and test1 account

truenas-1.png
 

jasonca

Dabbler
Joined
Dec 2, 2021
Messages
19
I created test3 and test4. But the net usersidlist did not show test3 and test 4.

truenas-2.jpg
 

jasonca

Dabbler
Joined
Dec 2, 2021
Messages
19
pdebit -L
command not found: pdebit
 

jasonca

Dabbler
Joined
Dec 2, 2021
Messages
19
I found the command.

pdbedit -L -v
 

jasonca

Dabbler
Joined
Dec 2, 2021
Messages
19
pdbedit -L |grep test
test:1033:test
test1:1034:test1
test2:1035:test2
 

jasonca

Dabbler
Joined
Dec 2, 2021
Messages
19
cat /etc/passwd |grep test
test:*:1033:1026:test:/nonexistent:/bin/sh
test1:*:1034:1027:test1:/nonexistent:/bin/sh
test2:*:1035:1028:test2:/nonexistent:/bin/sh
test3:*:1036:1005:test3:/nonexistent:/bin/sh
test4:*:1037:1029:test4:/nonexistent:/bin/sh
 

jasonca

Dabbler
Joined
Dec 2, 2021
Messages
19
User test4



truenas-3.png
 

jasonca

Dabbler
Joined
Dec 2, 2021
Messages
19
Thanks to anodos's help, the following command solved my problem.


rm /var/db/system/samba4/private/passdb.tdb
midclt call smb.synchronize_passdb -job
 

conghuayu

Cadet
Joined
Sep 30, 2021
Messages
2
As I mentioned in your ticket, net usersidlist output is not correct heuristic in this case.
Thanks for replying.

Also works for me.
But after running:
rm /var/db/system/samba4/private/passdb.tdb
midclt call smb.synchronize_passdb -job
The SIDs of users will be updated while the "share ACL" is not updated at the same time.
Run sharesec --view-all will only get old SIDs.
It would be great if there is a way to synchronize them.
Do you have such problems?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Thanks for replying.

Also works for me.
But after running:

The SIDs of users will be updated while the "share ACL" is not updated at the same time.
Run sharesec --view-all will only get old SIDs.
It would be great if there is a way to synchronize them.
Do you have such problems?
share_info.tdb is a key-value store based on SID values. In master / 13-stable I've reworked so that we base RID value on our user database entry id (freenas-v1.db), but this doesn't magically clean up if you choose to change netbios name. I think at a fundamental level if you have _large_ numbers of local users and groups on the NAS, you probably should look into using a directory service (i.e. MS or Samba AD).
 
Top