Problem: User IDs via winbind and getent don't match

Problem - User IDs via winbind and getent don’t match

Situation

Get the User ID

getent passwd user001
user001:x:2030:5001:User_001:/home/user001:/bin/bash

Get the SID for the User

wbinfo -n user001
S-1-5-21-1639544998-985729482-162645096-1125

Test in reverse

wbinfo -S S-1-5-21-1639544998-985729482-162645096-1125
1012

wbinfo -s S-1-5-21-1639544998-985729482-162645096-1125
DOMAIN+user001

As you can see the Posix ID does not match. It might help to flush the winbind cache.

Solution

Stop the winbind daemon, flush the cache and start winbind again.

root@ucs:~ systemctl stop winbind.service
root@ucs:~ net cache flush
root@ucs:~ systemctl start winbind.service

Possible Root Cause

Something might has changed and the winbind cache is not yet updated.

Mastodon