How to Change User Password on Debian?

This post will help you change your user password on Debian. Whether you need to change your password, update another user’s password, or enforce password policies, Debian provides powerful command-line tools to help.

Table of Contents
  1. How to Change User Password on Debian?
  2. Best Practices for Setting a Secure Password

How to Change User Password on Debian?

Changing Your Password in Debian

If you want to update your password, follow these steps:

1. Open the Terminal

Launch a terminal window, using the following Keyboard Shortcut:

Ctrl + Alt + T

2. Change the password using passwd command

i) Use passwd command and press Enter:

$> passwd

ii) Enter your current password as prompted for authentication.

iii) Enter New Password and press Enter

iv) Re-enter your new password for confirmation.

If both entries match, you’ll see a message confirming that your password has been updated successfully.


Changing Another User’s Password (As Root or Admin)

If you are a system administrator or have sudo privileges, you can change the password for another user.

1. Open the Terminal

Launch the terminal on your Debian system, using the Keyboard Shortcut below:

Ctrl + Alt + T

2. Change the password of another user using passwd command

i). Use the command below to change the password of another user using passwd command:

$> sudo passwd [username]

Replace [username] with the username of the user whose password you wish to change.

ii). Enter New Password and press Enter

iii). Re-enter your new password for confirmation.

If both entries match, you’ll see a message confirming that your password has been updated successfully.


Forcing a User to Change Password on Next Login

if you may want to force a user to change their password upon their next login.

Then, use the following command to force a user to change their password on the next login:

$> sudo passwd -e [username]

Replace [username] with the username of the user you want to force for a password change.

The above command immediately expires the user’s password, therefore, they will be required to set a new password when they log in.


Best Practices for Setting a Secure Password

For strong security, follow these password best practices:

  • Use a password with at least 12-16 characters
  • Include uppercase, lowercase, numbers, and special symbols
  • Avoid common words, personal names, and dates
  • Consider using a password manager to store secure passwords
  • Regularly update passwords (every 60-90 days recommended)
  • Enable two-factor authentication (2FA) for extra security