Operating System - HP-UX
1833648 Members
4409 Online
110062 Solutions
New Discussion

What is the command to lockout and remove Unix accounts?

 
SOLVED
Go to solution
John Goetz
Advisor

What is the command to lockout and remove Unix accounts?

Looking for the command line command.
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: What is the command to lockout and remove Unix accounts?

passwd -l can be used to lock an account. To remove a user, userdel is your boy. Man passwd, userdel for details.
If it ain't broke, I can fix that.
Raj D.
Honored Contributor

Re: What is the command to lockout and remove Unix accounts?

Hi John ,

1. Go to SAM .
2. User .
3. Choose User.
4. Deactivate user.

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Raj D.
Honored Contributor

Re: What is the command to lockout and remove Unix accounts?

Hi John ,

1. To Lock.
# passwd -l username.

[ -l Lock user account. In untrusted mode this replaces the encrypted password with *.] For further, $ man passwd


2. To Remove ,
# userdel username

or
# userdel -r username [ it also removes the users home directory.]

Enjoy ,

hth,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "
Jeff_Traigle
Honored Contributor

Re: What is the command to lockout and remove Unix accounts?

Just be very careful with that -r option on userdel. Be absolutely sure the home directory as defined in /etc/passwd is ok to delete. I had a system at my previous job that had one user's home directory within an application directory hierarchy. I wasn't being particularly careful that day and deleted the account along with the home directory. Caused a bit of extra work for myself as I restored the deleted directory so the other people working to get the server ready for production could continue their work. I hate when that happens.
--
Jeff Traigle