Reset SSSD ID Cache when connected to AD

,
1–2 minutes

Originally from

Found, then improved from

Found, then improved

Repost

the raven wiping a chalkboard of mixed-up number tags clean while the wolf holds a glowing amber directory book

If you are using SSSD to connect your linux box to AD then you might need to reset the cache that is used with mapping ids (uid and guid) to AD. If so here is quick set of commands to help do exactly that

Bash
systemctl stop sssd && 
rm /var/lib/sss/{db,mc}/* &&
sss_cache -E &&
# optionally clear debug logs &&
truncate -s 0 /var/log/sssd/*.log &&
systemctl start sssd

I found this useful tip on strackoverflow