cancel
Showing results for 
Search instead for 
Did you mean: 

Useradd fails

SOLVED
Go to solution
G V R Shankar
Valued Contributor

Useradd fails

Hi,

When I am trying to add the user using useradd or sam, it throws the following erros.

useradd test
Cannot add the entry

OS : HPUx 11.23

Please help.

Ravi.
5 REPLIES
Jaime Bolanos Rojas.
Honored Contributor
Solution

Re: Useradd fails

Hi,

Check the syslog.log for errors regarding this. Are you logged in as root?
Are you using a standard system or a trusted system?

What happens if you just type useradd without no options in the command line.
Check the /etc/password file for inconsistencies with the pwck commannd.

Regards,

Jaime.
Work hard when the need comes out.
James R. Ferguson
Acclaimed Contributor

Re: Useradd fails

Hi Ravi:

Echoing the return value might tell you more about the reason for the failure"

# useradd testuser
# echo $?

http://www.docs.hp.com/en/B2355-60130/useradd.1M.html

I would note in passing that using the name "test" is poor since it happens to be the name of a command. You will notice that I substituted "testuser" in my example.

Regards!

...JRF...
Vishu
Trusted Contributor

Re: Useradd fails

Hi Shankar,

Check for the /etc/passwd file. is the same error you are getting while trying from SAM. Try to enter useradd with the full option as

useradd -g -d -s test

and paste the error, if you are getting.

@JRF, regarding adding test user in a server, we can add it as i have tried. Refer the below output.

root # useradd test
root # cat /etc/passwd | grep -i test
test:*:120:20::/home/test:/sbin/sh

Thanks
Dennis Handly
Acclaimed Contributor

Re: Useradd fails

>JRF: I would note in passing that using the name "test" is poor since it happens to be the name of a command.

I don't think there is any syntax where an executable can be confused with a user name?
So only executables shouldn't be the name of a builtin.
G V R Shankar
Valued Contributor

Re: Useradd fails

Hi All,

Thank you for the replies. I could manage to solve the problem.

To begin with

1. System is trusted
2. To clarify, I used the word test as an example. In reality I was using muthusw
3. I tried to add the user using useradd (with all options), useradd (without options) and SAM.

Following was the error messages.

"Cannot add the entry"

Investigation
-------------
I have checked the permissions of /etc/passwd, /etc/group, /usr/sbin/useradd, files in /etc/skel

I have checked for the presence of /etc/ptmp

I tried to check for any process that was wrting to the /etc/passwd using lsof, but no luck

Resolution
----------
I have run authck -a. When I checked the o/p I found the following file.

/tcb/files/auth/v/muthusw

When I removed the file, useradd is successful.

Cheers,

Ravi.