Change a user’s UID
First login as root – Clean login – sudo will not work if you’re changing a UID on an already logged in user.
Find the user’s old UID:
1 |
id user1 |
uid=1000(user1) ….
Change the UID:
1 |
usermod -u 1001 user1 |
Update files and directories owned by the user to the new UID:
1 |
find / -uid 1000 -exec chown -h 1001 '{}' \+ |
Reboot and the UID has been changed.
Reply