I just deleted a user with "userdel", without deleting its home dir. Right after the deletion, I created a new user, with its own home dir.
What striked me as odd, was that the new user gets the UID of the deleted user (the last UID, incremented by 1).
Consequently, the new user also has ownership and full permissions on the files of the deleted user!
Is this normal behaviour? Is there a best practice on how to prevent this, short of specifying a UID each time when creating a new user?
(Tested on Linux Mint 17 and verified on OpenSuse 13.1)
usermod -c
to change the GECOS field to begin with the word DEPARTED. We then lock the account withpasswd -l
. It avoids UID reuse.