passwd

passwd

The passwd command in Linux is used to change the password for a user account. It is a powerful command that can be used to secure your system by making sure that all users have strong passwords.

The syntax of the passwd command is as follows:

passwd [username]

The username argument specifies the username of the user whose password you want to change.

If you do not specify the username argument, the passwd command will change your own password.

For example, the following command will change the password for the user johndoe:

passwd johndoe

This command will prompt you to enter the old password for the user johndoe. Then, it will prompt you to enter a new password for the user johndoe. You will need to enter the new password twice to confirm it.

The passwd command is a powerful command that can be used to secure your system by making sure that all users have strong passwords.

Here are some additional things to keep in mind about the passwd command:

  • The passwd command can only be used to change the password for a user account that you have permission to change.

  • The passwd command will not allow you to change your password to a password that is already in use by another user.

  • The passwd command will not allow you to change your password to a password that is too short or too simple.

It is important to be aware of these limitations when using the passwd command, so that you do not get locked out of your own account.

help

Usage: passwd [options] [LOGIN]

Options:
  -a, --all                     report password status on all accounts
  -d, --delete                  delete the password for the named account
  -e, --expire                  force expire the password for the named account
  -h, --help                    display this help message and exit
  -k, --keep-tokens             change password only if expired
  -i, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --lock                    lock the password of the named account
  -n, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -q, --quiet                   quiet mode
  -r, --repository REPOSITORY   change password in REPOSITORY repository
  -R, --root CHROOT_DIR         directory to chroot into
  -S, --status                  report password status on the named account
  -u, --unlock                  unlock the password of the named account
  -w, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS
  -x, --maxdays MAX_DAYS        set maximum number of days before password
                                change to MAX_DAYS

Last updated