You are on page 1of 2

Commands to assign/reset/lock/unlock user's Password

passwd - This command can be used in different contexts:-

syntax1 - sudo passwd userid (to change the password of given user) eg. sudo passwd roblake syntax2 - sudo passwd -l userid (to lock the user account) eg. sudo passwd -l roblake After every 4 wrong attempts account gets locked. syntax3 - sudo passwd -s userid (To check the status of user account.) eg. sudo passwd -s roblake eg. sudo passwd -as (To see the account status of all users.) syntax4 - sudo passwd -u userid (to unlock the user account.) eg. sudo passwd -u rolbake syntax5 - sudo passwd -f userid (It forces the user to change the password at the first login) eg. sudo passwd -f rolbake syntax6 - sudo passwd -x -1 userid (To make an user account as never expire, worx application requires such types of accounts.) eg. sudo passwd -x -1 rolbake syntax7 - sudo passwd -n 0 -x 0 eg. sudo passwd -n 0 -x 0 roblake -n the minimum number of days between password changes. If we set it to 0 it can be change today. -x Maximum number of days password change would be valid or expiration date. If we set it to 0 we have to change the password at the very first login.

NOTES - It takes 3 months or 13 weeks or 90 days an account to get expired. If we use the passwd command with options -n and - x we can specify the number of days and expiration date for an account Password length should be 8 characters and it can be alphanumeric. Once we set/reset the password we can inform the user over the phone (Only DHR Agencies) and we can send encrypted mails as well for other agencies.

You might also like