PASSWD

La commande passwd est utilisé pour changé le mot de passe d'un compte utilisateur.Un utilisateur sans privilége pourra utilisé passwd pour changer son propre mot de passe. Et un administrateur systéme (Superuser) pourra utiliser la commande passwd pour changer les mots de passes des autres utilisateurs ou définir comment le mot de passe d'un compte doit être utilisé ou changé.

passwd [OPTION] [UTILISATEUR]

Utiliser passwd sans préciser de nom d'utilisateur équivaut à changer votre mot de passe.

-a, - -allWhen used with -S (see below), this option will show the password status for all users. This option will not work if used without -S.
-d, - -deleteDelete a user's password (make it empty). This is a quick way to disable logins for an account, without disabling the account itself.
-e, - -expireImmediately expire an account's password. This forces a user to change their password the next time they log in.
-h, - -helpDisplay information about how to use the passwd command.
-i, - -inactive INACTIVEThis option is used to disable an account after the password has been expired for a number of days. After a user account has had an expired password for integer INACTIVE days, the user may no longer sign on to the account.
-k, - -keep-tokensKeep password tokens. Indicates that this user's password should only be changed if it has expired.
-l, - -lock* Lock the password of the named account. This option disables a password by changing it to a value which matches no possible encrypted value. It does this by adding a character at the beginning of the encrypted password.
* Note that this does not disable the account. The user may still be able to log in using another authentication method (an SSH key, for example). To disable the account, the superuser can use the usermod command with the option - -expiredate 1. This will set the account's expiration date to a date in the past, Ex : namely Jan 2, 1970.
* Users with a locked password are not allowed to change their password.
-n, –mindays MIN_DAYSSet the minimum number of days between password changes to MIN_DAYS. A value of zero for this field indicates that the user may change his/her password at any time.
-q, –quietQuiet mode; passwd will operate without displaying any output.
-R, –root CHROOT_DIRFor advanced users: this option will apply changes in the chroot directory CHROOT_DIR and use the configuration files from the CHROOT_DIR directory.
-S, –statusDisplay account status information. The status information consists of 7 fields:
  1. The user's login name
  2. password usability: L if the account has a locked password, NP if the account has no password, or P if the account has a usable password
  3. date of the last password change
  4. minimum password age
  5. maximum password age
  6. password warning period
  7. password inactivity period

In fields 4 through 7, password ages are expressed in days.

Specifying -a in addition to -S will display password status for all users.|

-u, –unlockUnlock the password of the named account. This option re-enables a password by changing the password back to its value before the -l option was used to lock it.
-w, –warndays WARN_DAYSSet the number of days of warning before a password change is required. WARN_DAYS is the number of days prior to the password expiring that a user will be warned that their password is about to expire.
-x, –maxdays MAX_DAYSSet the maximum number of days a password remains valid. After MAX_DAYS, the password must be changed.
  • linux/cmd/passwd.txt
  • Dernière modification : 08/12/2018 09:21
  • de 127.0.0.1