Operating System - HP-UX
1822196 Members
3697 Online
109640 Solutions
New Discussion юеВ

Command to disable NIS user

 
TCEQ UNIX
Advisor

Command to disable NIS user

What is the command to disable NIS user from command line
He who does not slow down at the sight of a police car is usually parked.
3 REPLIES 3
Steve Labar
Valued Contributor

Re: Command to disable NIS user

You could edit the /etc/passwd file at the NIS master and replace the password with an "*", the update the NIS maps using cd /var/yp;make

Good Luck.

Steve
Anil C. Sedha
Trusted Contributor

Re: Command to disable NIS user

We update our password file on the NIS master as

"X" in the password location.

But this happens through "itsync" .. don't know if you are aware of this or not. But you can manually also edit this.

Regards,
Anil
If you need to learn, now is the best opportunity
A. Clay Stephenson
Acclaimed Contributor

Re: Command to disable NIS user

While editing /etc/passwd on the NIS map and putting an impossible hash (like '*') in the passwd field (or writing a script to do it) is probably the best approach, a simple answer would be to do this on the NIS master:


usermod -s /usr/bin/false user1
cd /var/yp
make

This would make user1's shell /usr/bin/false and have the effect of disabling the account.
If it ain't broke, I can fix that.