Account lock unlock status in Linux


To check current password status of account in Linux.
Solution :
1. To check if account is lock or not.
Below are two examples of command outputs when account is lock and when account is not locked.
If account is locked out then passwd -S clearly shows “Password locked” or else its will show “Password set” as status.
Also by observing encrypted password field in /etc/shadow file, account status can be determined. If encrypted password entry is preceded by !! then account is locked.
2. Lock account manually.


Sometimes it is advisable to lock accounts manually if you are suspecting some malicious activity from account. In such cases, account can be locked instantly using below command. Please be advised that current live sessions of that account are not affected when you are locking it out. You have to clear off /terminate currently active sessions manually to kick user out of system. User wont be able to login system after lockout.
3. Unlock account manually.

To unlock any locked account on system below command can be used. Like above active sessions are not affected here as well.
SHARE

sangeethakumar

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment