LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Ubuntu default useradd uid (https://www.linuxquestions.org/questions/linux-general-1/ubuntu-default-useradd-uid-805989/)

lewkh 05-04-2010 10:16 PM

Ubuntu default useradd uid
 
Hi Folk,

As we type useradd -m tester01 -s /bin/bash in ubuntu without specified the uid and gid. Ubuntu useradd will be given the 1000:1000.

My question here is where can I change the default behavior? Or How do I ensure the default uid:gid are starting from 1000:1000?

Thanks

Regards
Lew

stuart_cherrington 05-05-2010 02:15 AM

You could try setting something in /etc/default/useradd.

Stuart.

A.Thyssen 05-05-2010 06:14 PM

Quote:

Originally Posted by stuart_cherrington (Post 3957741)
You could try setting something in /etc/default/useradd.

Stuart.

Configuation file and manpage for "useradd" does not indicate anything to specify the lowest UID to start from.

It also says it will add a UID that is larger than any other user, which means it will not 'fill in holes' in the UID sequence. Which means you can not have normal users with a lower UID than some group of 'special' users (such as temporary students).

Basically it's method of UID selection is rather brain dead, and if UID's are that important then it should be used as part of a larger user accounting system.

lewkh 05-05-2010 07:40 PM

Quote:

Originally Posted by stuart_cherrington (Post 3957741)
You could try setting something in /etc/default/useradd.

Stuart.

The file doesn't mention the setting.

jsnider 07-27-2010 03:37 PM

It's in /etc/login.defs. Look for UID_MIN.


All times are GMT -5. The time now is 12:01 AM.