Locking Linux Accounts

In order to lock a linux account a change of the password is the best option. Linux provides an automated method for locking accounts. To Lock an account (change password to something that is not typeable puts a ‘!!’ in front of the password)

passwd -l username

To unlock the account (change the password back to original value)

passwd -u username

To display password information on user (root only) This will display seven fields (username, status, date of creation, minimum password age, maximum password age, Number of days before password expires, minimum password length) in addition RHEL adds a translation for status after the seventh field.

passwd -S username

jacko LK 2010-01-30 0 99999 7 -1 (Password locked.)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.