How To Check User Account Locked or Not In Linux
if you’re not aware of how to check the user account locked in Linux. So there’re many ways to find out. You can lock the user either by passwd or usermod command.
You can also use the chage -l username command to check the status of the user locked or not in Linux. if it’s locked you will see /sbin/nologin at the end of shadow file.
Check Out: Force User to Change Password At first log in
Step 1: Lock the user password
passwd -l username
you can check user password locked or not in /etc/shadow file. If you find “!!” sign with this user that means password locked.
Step 2: To unlock the password
passwd -u username
Check the same file again. You must be seen there’s no “!!” means user password unlocked now.
Step 3: you can also lock the user account.
usermod -l username
To unlock the account,
usermod -U username
you can also check the user information with the below command.
you can also use this command to check the status of the user password,
passwd -S username
YouTube Link :