useradd and UID allocation



Hi All,

This is a general question regarding useradd command.
I've some doubts regarding UID allocation.
man page suggests that the UID defaults to the next available (unique) number
above the highest number currently assigned. For example, if UIDs 100, 105, and
200 are assigned, the next default UID number will be 201. (UIDs from 0-99 are
reserved for possible use in future applications.).
My question is: from where does useradd finds this highest numbered uid
allocated?
Is it /etc/passwd ??

If it is, then in one of my machines,
this scheme ( next available ) is not followed.
Following is the passwd file entries ( not the complete one, i think this much
is sufficient ) The user I am trying to create is myuser.


nobody:x:60001:60001:Nobody:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x Nobody:/:
ssmon:x:60000:60001:Sun StorEdge(tm) Configuration Service Agent
Monitor:/:/bin/false
ssadmin:x:59999:60001:Sun StorEdge(tm) Configuration Service Agent
Admin:/:/bin/false
ssconfig:x:59998:60001:Sun StorEdge(tm) Configuration Service Agent
Config:/:/bin/false
myuser:x:60011:100::/export/home/myuser:/bin/ksh


According to the allocation scheme, the uid of myuser should be
60003 but its 60011. I've verified that 60003 is not present in /etc/passwd
file.
Does that mean useradd is reading the next uid to be allocated from some other
files?



Thanks,
Binish
_______________________________________________
sunmanagers mailing list
sunmanagers@xxxxxxxxxxxxxxx
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



Relevant Pages

  • Re: ID Numbering in Group and Passwd
    ... Raises a problem tho that what UID will the 39,501th user have? ... Change the useradd / luseradd code to find the lowest unique uid / gid ... complete and scalable solution because you can change the UID, GID MIN, MAX ... the same thing would be using the same underlying code / library to achieve ...
    (Fedora)
  • Re: Linux useradd id sequence skip
    ... ok managed to get the answer from "man useradd", the uid and gid selection ... By default the next uid and gid is chosend ... Andy ...
    (comp.os.linux.misc)
  • Re: Start sshd from OpenSSH3.4p1
    ... >> to check for a typical low-numbered system UID, ... >> useradd line for Linux. ... >> It's somewhat useful to keep your system UID's of the typical user UID ...
    (comp.security.ssh)
  • Re: Start sshd from OpenSSH3.4p1
    ... > to check for a typical low-numbered system UID, and specifying it in the ... > useradd line for Linux. ... > It's somewhat useful to keep your system UID's of the typical user UID ...
    (comp.security.ssh)