Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 5632

Summary: Update...problem with useradd
Product: [Retired] Red Hat Linux Reporter: tom
Component: usermodeAssignee: Michael K. Johnson <johnsonm>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
URL: http://www.massachusetts.net/~tom/useradd.txt
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-10-07 19:20:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description tom 1999-10-06 15:05:44 UTC
Your little window is going to screw up the log lines but
here goes...


I have a real problem with useradd.
I have a list of over 2100 users I need to add in one shot.
The script I setup uses the useradd program. It doesn't
start the UID's at 500 like
it says to in /etc/login.defs

   /etc/login.defs
	#
	# Min/max values for automatic uid selection in
useradd
	#
	UID_MIN                   500
	UID_MAX                 60000


man useradd says it uses those settings to chose UID's

OK, Here is where things get weird. useradd starts UID's at
100
and moves up to 499 then starts over at 15. What the hell is
that?
Then it adds users till it hits 99 then yacks no more
UIDS...

While I add users here is the messages log...

Oct  6 10:36:36 orion useradd[13936]: new user: name=cti,
uid=495, gid=100, home=/home/users/cti, shell=/bin/bash
Oct  6 10:36:37 orion useradd[13937]: new user:
name=infonet, uid=496, gid=100, home=/home/users/infonet,
shell=/bin/bash
Oct  6 10:36:37 orion useradd[13938]: new user:
name=esquire, uid=497, gid=100, home=/home/users/esquire,
shell=/bin/bash
Oct  6 10:36:38 orion useradd[13939]: new user: name=dkmj,
uid=498, gid=100, home=/home/users/dkmj, shell=/bin/bash
Oct  6 10:36:38 orion useradd[13940]: new user: name=ricky,
uid=499, gid=100, home=/home/users/ricky, shell=/bin/bash
Oct  6 10:36:38 orion useradd[13941]: new user:
name=pondhome, uid=15, gid=100, home=/home/users/pondhome,
shell=/bin/bash
Oct  6 10:36:39 orion useradd[13942]: new user: name=brianb,
uid=16, gid=100, home=/home/users/brianb, shell=/bin/bash
Oct  6 10:36:39 orion useradd[13943]: new user:
name=getsales, uid=17, gid=100, home=/home/users/getsales,
shell=/bin/bash
Oct  6 10:36:40 orion useradd[13944]: new user:
name=gethelp, uid=18, gid=100, home=/home/users/gethelp,
shell=/bin/bash
Oct  6 10:36:40 orion useradd[13945]: new user: name=p84,
uid=19, gid=100, home=/home/users/p84, shell=/bin/bash
Oct  6 10:36:40 orion useradd[13946]: new user: name=tisay,
uid=20, gid=100, home=/home/users/tisay, shell=/bin/bash
Oct  6 10:36:41 orion useradd[13947]: new user:
name=dmardis, uid=21, gid=100, home=/home/users/dmardis,
shell=/bin/bash

...

Oct  6 10:37:39 orion useradd[14021]: new user: name=lapere,
uid=95, gid=100, home=/home/users/lapere, shell=/bin/bash
Oct  6 10:37:41 orion useradd[14022]: new user: name=rac1,
uid=96, gid=100, home=/home/users/rac1, shell=/bin/bash
Oct  6 10:37:42 orion useradd[14023]: new user: name=greg,
uid=97, gid=100, home=/home/users/greg, shell=/bin/bash
Oct  6 10:37:43 orion useradd[14024]: new user:
name=jlovell, uid=98, gid=100, home=/home/users/jlovell,
shell=/bin/bash


The output from useradd once it hits UID 98...

useradd: can't get unique uid
useradd: can't get unique uid
useradd: can't get unique uid
useradd: can't get unique uid
useradd: can't get unique uid
useradd: can't get unique uid

The command line I use... Has the passwords snipped from
another Unix system.

useradd-m -n -r pammy -p
'$1$dag7cC3a$N3C11h.16sE.O8vMZkNfX1'
useradd -m -n -r stardust -p
'$1$.h8nkYBG$XACifQo4W33dbwJ37gStA/'
useradd -m -n -r cent21 -p
'$1$J/hdolql$MUkZiu1Be5XOuY5wccpMu0'
useradd -m -n -r mark -p
'$1$JHthpT0R$.iu4Bmvx/ax/aLRE2MAfF/'
useradd -m -n -r robertf -p
'$1$0zBOeLVf$58FHhKhAjfpFkhsjdXwhf1'
useradd -m -n -r n1rby -p
'$1$iJh.Tn7f$KZoYmNOIoCCAbfgUzx2QG.'
useradd -m -n -r nasus -p
'$1$FMbeJL5f$jRtbTqDFNKkCehII5WiZr0'
useradd -m -n -r luck -p
'$1$iuGezdHM$J2c9ObqxGgIWJDwbrdj9Z/'


Please, What's going on?

This is a new RH5.2 install.
The password file was empty except for the basic system
accounts.
I've run all the nessary updates from RH's updates ftp site.

Comment 1 tom 1999-10-06 15:09:59 UTC
Here is a URL to a readable version of
what I posted. The web based tool for posting chopped my lines :(

http://www.massachusetts.net/~tom/useradd.txt

Comment 2 Michael K. Johnson 1999-10-07 19:20:59 UTC
-r adds a system account, one with an id lower than 500.
useradd is doing exactly what you asked it to, according
to the manual page.