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.)