Operating System - HP-UX
1824951 Members
3541 Online
109678 Solutions
New Discussion юеВ

Re: System insists UID duplicated but not in /etc/passwd

 
SOLVED
Go to solution

System insists UID duplicated but not in /etc/passwd

I'm using SAM to add a new user and I'm getting the following error when I accept the default UID - 400:
User ID "400" is already used.
Are you sure you want to reuse it?

I've checked the /etc/passwd file and the user account listing in SAM and neither show a user with this UID. If I try to add the account using the 'useradd' command, I get a similar error:
UID 400 is not unique

Question1: Why is the system insisting that UID 400 is in use when it is not shown in the /etc/passwd file?
Question2: Where does SAM get the next available UID from? Is this something that can be changed or reset to a specific starting UID?

Thanks for any help.
PS - This system is running HP-UX 11.11 in a 8x npar on a PA 8700 Superdome.
5 REPLIES 5
Steven E. Protter
Exalted Contributor
Solution

Re: System insists UID duplicated but not in /etc/passwd

Shalom,

1. Perhaps UID 400 did exist and still has a process open or a file owned.
2. Should really use a script. But useradd or sam seem to pick the lowest available UID. Example we leave our users at uid 1000 and up. There are lots of open users in the under 1000 range. sam and useradd default to the lowest available id in the lower range. Our NIS setup uses an 11.00 box (shame on us, I know). Your results may vary based on OS version and whether or not you use NIS.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Patrick Wallek
Honored Contributor

Re: System insists UID duplicated but not in /etc/passwd

Is your system trusted? If so, it may also be looking in /tcb/files/auth/* directories at the user information.

Try running:

# pwck
(This will check /etc/passwd for problems)

If your system is trusted run the following command to check the protected password db (the stuff in /tcb/files/auth/*):
# pwck -s
Sandman!
Honored Contributor

Re: System insists UID duplicated but not in /etc/passwd

Or you could allow a duplicate UID by specifying the "-o" command line option to the useradd command.

~cheers
Sandman!
Honored Contributor

Re: System insists UID duplicated but not in /etc/passwd

Verify that it is not an NIS enabled user. Check the "Networking Features" of the useradd(1M) manpage.

~cheers

Re: System insists UID duplicated but not in /etc/passwd

Thanks for the replies folks. It turns out we did have an old user with that UID. No running processes, but there was an old unused homedir still out there.

We found the homedir, removed it and the error messages went away. We then created the new user.

Also, it does seem that the lowest available UID is what is used by SAM for automatic UID assignment. I'm gonna continue to check to see if that can be set manually to a higher starting UID.

Thanks again for all the suggestions. The command 'pwck -s' also showed many inconsistencies that we'll now be cleaning up. We aren't using NIS but the suggestion was still a good one. Great suggestions all. Much appreciated.