Operating System - HP-UX
1748076 Members
5389 Online
108758 Solutions
New Discussion

Re: unable to create the user in HP-UX

 
rajesh73
Super Advisor

unable to create the user in hp-ux

i am unable to cretae the user acount ,,   it gives error----

 

#useradd -u 140 -m -d /home/rajesh rajesh

"Loing name not unique"

 

i was checked in /etc/passwd file , but in this file rajesh user name not available. but i am still facing the issue.

 

finally i was checked in /etc/shadown file, in this file the rajesh user name exsists, how to remove the rajesh user account name in shadow file.

 

Plesae share the safe methold to remove the name in /etc/shadown file.

 

7 REPLIES 7
Dennis Handly
Acclaimed Contributor

Re: unable to create the user in HP-UX

Have you tried using userdel(1m) first?

Otherwise use vipw(1m) to copy that entry from /etc/shadow to /etc/passwd, then use userdel(1m), then try adding.

rajesh73
Super Advisor

Re: unable to create the user in hp-ux

Hi Dennis,

Could you please share the procedure
Dennis Handly
Acclaimed Contributor

Re: unable to create the user in HP-UX

>Could you please share the procedure?

 

I thought I did.  Did userdel(1m) work?

If it fails because of the missing entry in /etc/passwd, you need to create one using vipw(1m).

rajesh73
Super Advisor

Re: unable to create the user in HP-UX

hi,

 

one more information,, this rajesh is root equvalent id. so rajesh user id is 0.  so we cannot directlry delete this account.

 

kindly confirm for editing shardow file, please find the below procedure .

 

1.backup the file /etc/passwd, /etc/group ,/etc/shadow ,/etc/gshadow

 

2. vipw -s --remove the name rajesh in the shadow file

 

 

 

Dennis Handly
Acclaimed Contributor

Re: unable to create the user in HP-UX

>rajesh is root equivalent id. so rajesh user id is 0.  so we cannot directly delete this account.

 

I see nothing in userdel(1m) that deletes the files by default.

 

>2. vipw -s -remove the name rajesh in the shadow file

 

vipw(1m) only works on passwd(4).

 

 

rajesh73
Super Advisor

Re: unable to create the user in HP-UX

->vipw(1m) only works on passwd(4).

 

it means we can only delete passwd file ,, so then how to remove the entry in shadow file.

 

 

Dennis Handly
Acclaimed Contributor

Re: unable to create the user in HP-UX

>it means we can only delete passwd file

 

But you can add to passwd(4).