The other day, I deleted a user from one of our servers. That user had the ID 1002
.
Today, I've added a new user to the system. To my surprise, he got the user ID 1002
. Because I neglected to delete the homedir of the deleted user, the new user now owns the homedir of the old user (as well as all other resources that were previously owned by 1002
).
I would have assumed that user IDs are never reused to avoid any conflicts like this. Why are they recycled and should I care/take precautions?
/etc/passwd
. So if you remove the last user added (which will have had the highest number) the next user created will reuse that number. – StarNamer Oct 29 '12 at 15:58