Last updated:

Quick answer: to change your own password on Debian 13 (Trixie) or Debian 12 (Bookworm), open a terminal and run passwd. To change another account’s password, run sudo passwd username. If you have forgotten the password, you can reset it from the GRUB boot menu (Method 3).

Your situation What to use Needs
You know your current password passwd (Method 1) or Settings > Users (Method 2) Your current password
You are admin and want to reset another user sudo passwd username sudo or root
You forgot the password and have the machine in front of you Edit the boot entry in GRUB (Method 3) Physical or console access, unencrypted disk
You forgot the password of an encrypted disk Not recoverable with these methods Your disk passphrase or a backup

The commands are the same on both releases. The screenshots were taken on Debian 12 with GNOME, so a Debian 13 desktop may look slightly different, but the terminal steps do not change.

Method 1: Change Password Using CLI

To change the password using the Command Line Interface or CLI, use the “passwd” command with the user’s name. After that, enter the current password and then enter the new password twice for the user to confirm the change. To learn the process in detail, simply go through the following sections:

Change User’s Password

Start the process by visiting the terminal from the Debian machine and entering the “passwd <user>” command. Change the <user> with the actual name of the user on your machine as mentioned below and hit enter:

passwd user

Running the above command asks the user to type the current password of the user for its authentication and hit enter:

Terminal prompting for the current password after running passwd on Debian

After the authentication, simply set the new password for the user by typing it in the “New password:” section and hit enter again:

Terminal prompting for the New password on Debian

Now, again type the new password to confirm it in the “Retype new password:” section and execute it using the enter key from the keyboard:

Terminal prompting to retype the new password on Debian

Executing the above configurations updates the password with the success message as displayed in the following screenshot:

Terminal showing password updated successfully after passwd on Debian

The above section has updated the password for the <user> without accessing the root user or admin privileges. Now, let’s access the root user and change its password using the following section:

Change Root’s Password

To get the administrative privileges and access the root user, simply execute the following command. This step needs root or sudo rights, so make sure your account can use sudo on Debian 12 if you are not already root:

su -

Executing the above command prompts the user to enter the password for the root user and hit enter:

su - prompting for the root password on Debian

Inside the root user, run the following command to set the new password in the Debian machine:

passwd

Running the above command prompts you to enter the new password and hit enter from the keyboard:

Root terminal prompting for a new password after running passwd

Again, type the password for the root user to confirm the process and hit enter at the end:

Root terminal prompting to retype the new root password

Hitting enter updates the password for the root user as displayed in the following screenshot:

Terminal showing the root password updated successfully

Now, we have learned how to change the password for both(root and user) users with the help of commands. Now, we can simply delete the user’s password from the root user, and its process is explained below:

Delete User’s Password From Root

In the root user, execute the passwd command with the “-d” flag to delete the password of the user using the following command:

sudo passwd -d user

Warning: passwd -d removes the password completely, which leaves the account with no password. Use it only on a machine you control, and set a new password straight away. If your goal is only to make the user choose a new password, use sudo passwd --expire user below instead.

The following screenshot displays that the password is deleted or changed successfully:

Terminal output after running sudo passwd -d on a Debian user

A related flag is the “–expire” option. Unlike -d, it does not delete the password; instead it marks the password as expired so the user is forced to set a new one at their next login:

sudo passwd --expire user

The password has now been marked as expired, as confirmed with the help of the following snippet:

Terminal output after running sudo passwd --expire on a Debian user

After that, simply reboot the system to implement the changes:

reboot
Rebooting Debian from the terminal with the reboot command

Set User’s Password

After deleting the user’s password, you need to set a new password as the login window asks. The following screenshot displays that you need to set the password for the user to log in to the user:

Debian login screen asking the user to set a new password

To set the password for the user, simply type the password in the tab highlighted in the following screenshot:

Debian login screen password field for setting the new password

After that, it asks the user to retype the password to confirm the process and hit enter to complete the process:

Debian login screen asking to retype the new password

The following screenshot displays that you have successfully updated the password and logged in using the new password:

Debian desktop after logging in with the new password

The first method has explained the process of changing the password using the commands in the terminal. Now, simply use the Graphical User Interface or GUI to change the password of the Debian’s user or the users. To do so, simply visit the Settings page and open the Users page from the left panel of the page. After that, open the password page to change the password from there, and confirm the process by clicking on the “Change” button:

Learn the process of changing the password using GUI in detail with the help of the following section:

Method 2: Change Password Using GUI

To change the password in Debian using GUI, simply locate and click on the “Settings” icon by searching it from the “Activities” page. The exact panel looks slightly different on GNOME versus an alternative desktop such as KDE on Debian 12, but the Users section works the same way:

GNOME Activities search for Settings on Debian

Clicking on the “Settings” icon brings you to its page and from there you need to click on the “Users” page from the left panel. From the “Users” page, click on the “arrow” button from the “Password” tab as mentioned below:

GNOME Settings Users page with the Password arrow button

Type the current password to confirm the authenticity of the user, and then type the new password twice. After that, simply click on the “Change” button from the top of the window to confirm the process of password change:

GNOME change password dialog with current and new password fields

We have changed the password using the GUI and CLI commands but for that, you require the existing password. However, changing the password when you can’t remember the existing password can be done by setting it as the time of boot. The following methods explain the process in detail with the help of commands and screenshots:

Method 3: Change the Password While Booting

Before you start: this works only when you have physical or console access to the machine, the disk is not encrypted (with LUKS you are asked for the disk passphrase first, and this method does not bypass it), and GRUB is not password-protected. Use it only on systems you own or administer. If the GRUB menu does not appear at boot, hold Shift (BIOS) or tap Esc (UEFI) while the machine starts. On a virtual machine, use the hypervisor’s console.

To change the password at the time of booting, simply select the “Debian GNU/Linux” option from the GNU GRUB menu. After that, simply press “e” from the keyboard to edit the commands before booting:

GRUB menu with Debian GNU/Linux selected and e to edit

Hitting “e” opens the following page and from there you need to locate the Linux line at the end of the page:

GRUB edit screen showing the linux boot line

Visit the line by navigation arrows from the keyboard as displayed in the above snippet:

After that, change the “ro quiet” from the end of the line as mentioned in the above screenshot and replace it with the following command:

init=/bin/bash

After changing the above configurations, simply press “F2” or “Ctrl + X” from the keyboard:

GRUB boot line edited with init=/bin/bash

Saving the above configurations displays the following screenshot to write the commands and change the password of the user:

Root shell prompt after booting with init=/bin/bash

Execute the following command to remount the root directory making it readable and writable:

mount -o remount,rw /

The following screenshot displays the success message as the root directory is remounted:

Terminal showing the root filesystem remounted read-write

Now, remount the /proc files from the directory using the following command:

mount -o remount,rw /proc

After that, type the following command to set the password for the root user:

passwd
Terminal running passwd as root in the recovery shell

Type the new password twice and hit enter to confirm the password for the user:

Terminal prompting to retype the new root password in the recovery shell

The following screenshot displays the successful message as the password is updated for the root user:

Terminal showing the password updated successfully in the recovery shell

After updating the password, restart the machine. In an init=/bin/bash shell no init system is running, so Ctrl+Alt+Delete may do nothing. The commonly documented ways out are to continue the normal boot with:

exec /sbin/init

or to force a reboot with reboot -f. Run sync first so the new password is written to disk. (I did not run this recovery procedure in this session; the steps follow the screenshots above and standard Debian recovery practice.) Log in with the new password and confirm it works.

That’s all about the process of changing the password with multiple methods like CLI or GUI.

Password changes need the right permission

A normal user can change their own password. Changing another account’s password requires sudo or root privileges, whether you are sitting at the machine or connected over a remote desktop on Debian 12. If sudo says you are not allowed, see how to enable sudo for a user on Debian.

Troubleshooting

Message or problem Cause Fix
passwd: Authentication token manipulation error The root filesystem is mounted read-only, typical in the GRUB recovery shell Run mount -o remount,rw / and try passwd again
BAD PASSWORD: The password is shorter than 8 characters Password quality check Choose a longer password; root may be allowed to set a weak one after the warning, normal users are not
user is not in the sudoers file The account has no sudo rights Log in as root with su - or enable sudo for the user
GRUB menu never appears Menu timeout is 0 or hidden Hold Shift (BIOS) or tap Esc (UEFI) during boot
New password rejected at login Wrong keyboard layout at the login screen Check the layout indicator and type the password in a text field to confirm

FAQ

How do I change my password in Debian from the terminal?

Run passwd, type your current password, then type the new password twice. Nothing is shown while you type.

How do I change the root password in Debian?

Run su - and enter the current root password, then run passwd. If your account has sudo access you can run sudo passwd root instead.

What if I forgot my Debian password?

Use Method 3 to reset it from the GRUB boot menu. It requires access to the machine and an unencrypted disk; there is no way to recover an encrypted disk without the passphrase.