passwd command is used to change password. In linux system a user can change its password by typing `passwd`.
Syntax : passwd [option] [username]
If you donot have root privileges then you can change the password of account you are logged in. If you want to change the password of other account , you must log in as root user and or use `sudo passwd [username] `.Super user can change any password. It asks for older password and new password to change then it again asks to confirm the new password.
1. If your new and old password are same then it shows password unchanged.
2. If your old and new passwords are too similar it will tell you to choose new password.
3. Linux have security enchanced password in new kernels so, if your password are simple then it asks again for new password.
4. password must be atleast 6 character long.
5. It must have digit , punctuation mark and lower alphabets.
Options used in passwd :These options can be used as arguments for purpose , see syntax for options.
1. [ -d | --delete ] :It is used to delete the password of the user. It makes the user passwordless. Ex-: passwd -d [username]
2. [ -e | --expire ] :This option is used to expire the password of other user. It is done by superuser to normal user. It is helpful to make people change password regularly.
3. [ -l | --lock ] :It is used to lock the user from changing its password.
4. [ -u | --unlock ] :It unlocks the user from changing its password.