The passwd command has several options that can be used to manage user passwords and accounts. Here are some commonly used options:
-
-d: Deletes the password for the specified user, effectively allowing passwordless login.sudo passwd -d username -
-l: Locks the specified user account, preventing the user from logging in.sudo passwd -l username -
-u: Unlocks a previously locked user account.sudo passwd -u username -
-e: Forces the user to change their password at the next login.sudo passwd -e username -
-n: Sets the minimum number of days between password changes.sudo passwd -n days username -
-x: Sets the maximum number of days a password is valid before it must be changed.sudo passwd -x days username -
-w: Sets the number of days before password expiration during which the user is warned.sudo passwd -w days username -
-i: Sets the number of days after a password expires until the account is permanently disabled.sudo passwd -i days username
These options allow administrators to manage user passwords and account statuses effectively.
