Operating System - HP-UX
1836612 Members
3623 Online
110102 Solutions
New Discussion

Re: Unable to delete a User

 
SOLVED
Go to solution
Puneet Singh tandon
Frequent Advisor

Unable to delete a User

I have created a user and given it root privileges by using.
useradd -u 0 -g 0 ......
after seeing the /etc/passwd and /et/group file.
Now if i try to delete the user it says
"Login xxxxx is currently in use."
How do i delete this user.
Also when i see the output of who i dont see this user but root.
Im using Hp-UX11.11

5 REPLIES 5
Peter Godron
Honored Contributor
Solution

Re: Unable to delete a User

Hi,
can't you modify the /etc/passwd file by hand to change the uid of the new user?
H.Merijn Brand (procura
Honored Contributor

Re: Unable to delete a User

user 0 is root, and should be the first entry in /etc/passwd

deleting a user this way cannot be done if you share user-ID's (which IMHO is bad practice anyway)

# EDITOR="" vipw

remove the offending line, and save
Don't repeat that mistake, please.

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Puneet Singh tandon
Frequent Advisor

Re: Unable to delete a User

But then how do i create a user having all the root privileges.
I have a similar user on my system already
with all the root priviledges.
I want to either change its name or create another user.
And does changing the logon_name using usermod has any alternate effect too.
H.Merijn Brand (procura
Honored Contributor

Re: Unable to delete a User

ls, and all other utils, show the *first* name from /etc/passwd that matches the given user ID, so even if you create 12 new root users like this, which *is* a legal procedure, you will still always see root as the stringified user

the default utilities for adding and deleting users do not support this scheme, so you will have to use vipw, and be very careful.

A MUCH better solution however would be to not use root users at all, but install sudo and make a good scheme to those users

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
DCE
Honored Contributor

Re: Unable to delete a User


As Procura stated, you *can* have multiple ids with a uid of zero.

However you are not ctually granting root privleges to a user, rather you are actually creating muliple aliases for the root account, with no way to differentiate between them.

Again as Procura stated, sudo, which is available here:
http://gatekeep.cs.utah.edu/hppd/hpux/
is a much better way to allow users root level access. They log in as themselves and then switch to root, using their own password. (keeping roots pasword secure)

The way your system is currently set up with multiple ids with a uid of zero, is a big security risk, and as such would fail any security audit of the system.