Operating System - HP-UX
1838576 Members
4057 Online
110128 Solutions
New Discussion

How-to disable login ID in command line

 
yc_2
Regular Advisor

How-to disable login ID in command line

Hi,

How to disable and enable a login using command line.


Thanks in advance,
YC
4 REPLIES 4
Michael Tully
Honored Contributor

Re: How-to disable login ID in command line

Hi,

This will only work if your system is
trusted:

# /usr/lbin/modprpw -k userid (to disable)
Once disabled you run it again to enable

If your system is not trusted do this.
# vipw
Place a '*' mark where the encrypted password
is, like so:

fsdmo:Gn.L7WCuZi3PU:103:202:fsdmo,,,:/home/fsdmo:/usr/bin/ksh
to
fsdmo:*:103:202:fsdmo,,,:/home/fsdmo:/usr/bin/ksh

Save the file.
HTH
-Michael
Anyone for a Mutiny ?
Sridhar Bhaskarla
Honored Contributor

Re: How-to disable login ID in command line

To lock an account use the command

passwd -l user_id

This will lock the account which is like disabling the account.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
T G Manikandan
Honored Contributor

Re: How-to disable login ID in command line

Hello,
I have tried using
#passwd -l to lock the user account
#passwd -d to unlock the user account.
passwd -d removes the passwd for the user and he has to set the passwd if reqd.
Be sure and careful in giving the username.

Thanks
G Manikandan
Michael Tully
Honored Contributor

Re: How-to disable login ID in command line

Also....

/usr/bin/passwd -r files -l userid (to disable)
/usr/bin/passwd -d userid

-Michael
Anyone for a Mutiny ?