A password(commonly knows as passwd in linux) is an unspaced sequence of characters used to determine that a computer user requesting access to a computer system is really that particular user. Typically, users of a multiuser or securely protected single-user system claim a unique name (called a user ID) that can be generally known. In order to verify that someone entering that user ID really is that person, a second identification, the password, known only to that person and to the system itself, is entered by the user. Most networks require that end users change their passwords on a periodic basis.
passwd command
The passwd command is used to create and change the password of a user account. A normal user can run passwd to change their own password, and a system administrator (the superuser ROOT) can use passwd to change another user’s password, or define how that account’s password can be used or changed.
The passwd command is used to create and change the password of a user account. A normal user can run passwd to change their own password, and a system administrator (the superuser ROOT) can use passwd to change another user’s password, or define how that account’s password can be used or changed.
PASSWD SYNTAX
Change the password for Normal user
When you logged in as non-root user like anu in my case and run passwd command then it will reset password of logged in user.
When you logged in as root user and run passwd command then it will reset the root password by default and if you specify the user-name after passwd command then it will change the password of that particular user.
When you logged in as root user and run passwd command then it will reset the root password by default and if you specify the user-name after passwd command then it will change the password of that particular user.
Display Password Status Information
To display password status information of a user , use -S option in passwd command.
In the above output first field shows the user name and second field shows Password status (PS = Password Set , LK = Password locked , NP = No Password ), third field shows when the password was changed and last & fourth field shows minimum age, maximum age, warning period, and inactivity period for the password.
we can display password status information for all users at a time by using the option –Sa
Removing Password of a User
we can remove the password for particular user by using option -d
Lock the password of System User
Use ‘-l‘ option in passwd command to lock a user’s password, it will add “!” at starting of user’s password. A User can’t Change it’s password when his/her password is locked.
Unlock User’s Password using -u option
use -u option to unlock the user accounts locked by passwd -l option
Setting inactive days using -i option
use -i option along with passwd command to set inactive days for a system user. This will come into the picture when password of user expired and user didn’t change its password in ‘n‘ number of days ( i.e 7 days in my case) then after that user will not able to login.
Setting Minimum No.of Days to Change Password using passwd -n option
Using the option -n along with passwd command we can set the minimum number of days to change the password. A value of zero shows that user can change it’s password in any time.
Setting the Warning days before password expire using passwd -w option
Using the option -w along with passwd can be used to set the warning days before the password expires.
Thanks
Gurpreet Singh
Gurpreet Singh
No comments:
Post a Comment