uid greater than...

Mike Reinehr cmr
Sat Dec 30 09:35:21 PST 2006


On Saturday 30 December 2006 07:36, Jorge Almeida wrote:
> When creating a new user, is there some way to force the uid to be
> greater than some value? I know I can do "useradd -u 10030 ...", for
> example, but that's not what I mean. The man page for useradd says that
> by default (i.e., without using the -u flag) the new user uid will be
> the smallest value greater than 999 and greater than every other
> existing user's uid. I want this behaviour with 10000 instead of 999
> (for some users, not for all of them).
> Is there some way do do it at all (short of cooking a wrapper that would
> check the uid of existing users)?

Check out the `adduser` command (rather than the `useradd` command). It has a 
configuration file (/etc/adduser.conf) which, among other options includes:

# FIRST_UID to LAST_UID inclusive is the range of UIDs of dynamically
# allocated user accounts.
FIRST_UID=1000
LAST_UID=29999

You also have the option of using multiple configuration files.

HTH

cmr
-- 
Debian 'Etch': Registered Linux User #241964

"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC



More information about the Linux-users mailing list