1837650 Members
2971 Online
110117 Solutions
New Discussion

Unable to add user id

 
SOLVED
Go to solution
steven Burgess_2
Honored Contributor

Unable to add user id

Hi

I have a user that previously belonged on one of our systems. I have a feeling that when the user was last removed the -r option wasn't specified with the userdel command.

I have checked the system and can see no files that belong to the user.There details are not in /etc/passwd

When attempting to add, i get the message

useradd K462LTE
chown: unknown user id K462LTE
Cannot modify home directory

If i try to remove the user i get

userdel -r K462LTE
Login 'K462LTE' does not exist

Can anyone help
take your time and think things through
10 REPLIES 10
Alan Casey
Trusted Contributor

Re: Unable to add user id

After you run useradd K462LTE
Is this user then in the /etc/passwd file?

If not then useradd has failed:

Please run:

useradd K462LTE
cat /etc/passwd | grep K462LTE

And please let us know the output.
Alan Casey
Trusted Contributor

Re: Unable to add user id

I think you need a patch as there are patches for useradd.

What OS levle are you on?

For HP-UX 10.20 patch PHCO_18925
steven Burgess_2
Honored Contributor

Re: Unable to add user id

I am running 10.20

The user id is not in /etc/passwd after
i run useradd

I do not have that patch

Will this cure the problem

Thanks
take your time and think things through
steven Burgess_2
Honored Contributor

Re: Unable to add user id

just nipping to lunch, reply when i get back thanks
take your time and think things through
G. Vrijhoeven
Honored Contributor

Re: Unable to add user id

Hi,

You can use useradd -o to add the user. The -o option allows the UID to be non-unique.

Hope this will help,

Gideon

Alan Casey
Trusted Contributor

Re: Unable to add user id

There can be no guarantee but this patch and patches it superseeds have fixed:

- erroneously reports an error "Cannot creat home directory"

- useradd(1M) does not allow multiple users to share generic home directory. usermod(1M) reports "Can not modify home directory" when changing primary group of a user.

Amongst a lot of other things. I think it would be a good thing to install this.

Also check that the home directory for this user does NOT exist already, if so try to user a different home directory (useradd -d)
Also check that no filesystems are full.
George_Dodds
Honored Contributor

Re: Unable to add user id

Hi Steve,

I agree with Alan i'd check to see if there is allready a home directory for that uid and if there are any entries in /etc/passwd.

Do you work for a courier company by any chance?
steven Burgess_2
Honored Contributor

Re: Unable to add user id

there is no home directory for this user or and entry in /etc/passwd

Hello there George, yes i do. And do remember you.
take your time and think things through
George_Dodds
Honored Contributor
Solution

Re: Unable to add user id

Is this a trusted system?

usr/lbin/getprdef

you'll either get message system is not trusted
or return code of 2 and options for the command.


steven Burgess_2
Honored Contributor

Re: Unable to add user id

Thanks for your help guys

I have found that the system is trusted, therefore putting another file in /tcb/files/auth/K, whoever removed the id didn't do it cleanly. This left the file in the directory and just removed the encrypted passwd

Cheers
take your time and think things through