Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

useradd: error uid 100 is already in use

677 views
Skip to first unread message

mark

unread,
May 25, 2003, 12:48:51 PM5/25/03
to
I am trying to figure this problem out and am having no luck
what-so-ever. I have a script with the following line:

useradd -g 10 -d /USERS/$username -s /usr/bin/bash -m -k
/etc/skel/operator $username;

The first time I run the script I have no problem adding a new user.
The new user added however is given the UID 100, not a problem since
that UID is not in use by anyone else. But I have two users on my
system with UID's of 1001 and 1002. From the useradd man page: "The
UID defaults to the next available (unique) number above the highest
number currently assigned." So shouldn't the first time I run the
useradd function give the user a UID of 1003 instead of 100?

The second time I run the script I get the following error:

UX: useradd: ERROR uid 100 is already in use. Choose another.

I can't for the life of me figure out why the useradd function is
defaulting to 100 and then not trying for the next unused UID. Any
help would be greatly appreciated.

Thanks,
Mark

John Briggs

unread,
May 25, 2003, 10:04:16 PM5/25/03
to
This is a suggestion to try.
I seem to remember having this problem after hardening my host.
I used 'truss' to find a required executable that had been deleted.

-John


in article a24543af.03052...@posting.google.com, mark at

mark

unread,
May 26, 2003, 4:57:01 PM5/26/03
to
Thanks for the help. After running 'truss' I was able to figure out
that I was missing the file /usr/bin/getent. I copied that file from
another workstation to mine and then the 'useradd' function started
working the way it is supposed to.

Thanks again.

Mark

mark

unread,
May 26, 2003, 4:57:01 PM5/26/03
to

Paul E. Ratty

unread,
May 31, 2003, 10:13:18 AM5/31/03
to
Just curious if you know why the file was missing in the first place?

Paul

"mark" <msh...@vt.edu> wrote in message
news:a24543af.03052...@posting.google.com...

Anthony Mandic

unread,
May 31, 2003, 10:23:41 AM5/31/03
to
"Paul E. Ratty" wrote:
>
> Just curious if you know why the file was missing in the first place?

Mostly like because the NIS package SUNWnisu (to which getent
belongs) wasn't installed. I came across this the other day
when I configured a new system and left out NIS. A dependency
bitched about it. It turned out to be an rc script (in /etc/rc2.d
I think) that launched WBEM. It calls getent and I was left
wondering why getent was in that package.

-am © 2003

Chris Thompson

unread,
May 31, 2003, 11:16:37 AM5/31/03
to
In article <3ED8BAED...@hotmail.com>,

Especially since the getent(1m) man page specifies "Availability ... SUNWcsu"
in its ATTRIBUTES section. And SUNWcsu is surely where it ought to be.

Chris Thompson
Email: cet1 [at] cam.ac.uk

Casper H.S. Dik

unread,
Jun 2, 2003, 10:55:31 AM6/2/03
to
"Paul E. Ratty" <pratt...@attbi.com> writes:

>Just curious if you know why the file was missing in the first place?

"getent" is wrongly packaged as being part of "NIS+".

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

0 new messages