Are the UID of users from a domain maintained locally in a machine?

I have seen many of my office Linux machines connected to some domain.

I am wondering as if a machine maintains the list of UID of users in a domain, locally? If yes, then how and who does it? if not then can there be a possibility that a local user and a domain user may have same UID?

For example:

Suppose I have a linux machine connected to a domain say “abc” and I have a user in the domain say “xyz” which has a uid say ‘1234’, Now my question is if I create a local user using adduser, lets say “lmn”. Is there a possibility that user “lmn” and “abc” can have same UID? or is it genius of the operating system that it always gives a different UID or someone has to maintain it for the operating system?

Answer

If a machine is configured to look to LDAP or Active Directory for user information, local user management commands such as “useradd” will pick up on the existence of any duplicate uid/uidnumber entries in the domain and refuse to create the account. It does not store all domain user information locally (though it may cache it).

Duplicate entries can be created by editing the relevant local files (/etc/passwd & /etc/shadow) or by temporarily disabling lookups to LDAP/AD. This is rarely a good idea.

Is that what you were looking for?

Attribution
Source : Link , Question Author : LearningNinja , Answer Author : Andy

Leave a Comment