Operating System - HP-UX
1753820 Members
8711 Online
108805 Solutions
New Discussion юеВ

Re: unable to delete user account using userdel and nis on hpux 10.20

 
SOLVED
Go to solution
Mark Malko
Occasional Advisor

unable to delete user account using userdel and nis on hpux 10.20

I have to delete a bunch of accounts off of our system, which is using NIS. I just used sam. I have found out that sam only supports 8 characters for the username. Even though the username has 10 characters, i can only input 8, but it still finds the account. Trying to remove it at that point gives me an error "This user does not exist". I tried userdel, and i get a simliar message.
I have no idea how these users got created in the first place.
Is there a safe way to do this? I could just vi the passwd file, but i do not know NIS well enough.
Any one have any ideas?

thanks a bunch
mark
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: unable to delete user account using userdel and nis on hpux 10.20

This sounds more like a trusted system than NIS
but, yes you can delete the users by editing the passwd file on the NIS master server.

If you must do it this way, do it like this:

1) Login as root in at least 2 sessions on the NIS master server. That way you can get yourself out oof trouble almost as fast as you got yourself into it.
2) Make a safe copy of the passwd file.
3) Edit the passwd file using vi or better vipw. Remove the desired users or better simply defeat the logins by putting a '*' in the passwd field of each user.
4) Save the file.
5) cd /var/yp
6) make

You are done.

By the way, if any users have passwd entries on NIS clients that precede the '+' passwd entry, those will need to be found and disabled as well.
If it ain't broke, I can fix that.
S.K. Chan
Honored Contributor

Re: unable to delete user account using userdel and nis on hpux 10.20

Are you trying to remove the local password entry or the entry in the NIS password file ? The userdel command only deletes LOCAL password entry. Do ..
# man userdel
for details ..
If you want to delete the entry found in the NIS passowrd file you have to do this on the NIS server itself. Simply edit the password file ..
# cd /etc
# cp passwd passwd.org
# vipw
Then you will have to push the updated password file out to your NIS domain by running ..
# /var/yp/ypmake
After the NIS password is pushed out, login to any NIS client and run ..
# ypcat passwd|grep
to make sure the entry no longer exist.
Mark Malko
Occasional Advisor

Re: unable to delete user account using userdel and nis on hpux 10.20

Thanks for the responses guys....

Just editing the passwd file, and doing a ypmake and everything is fine!

thanks again.
mark