How to Change a Password on Debian 12

Password is the combination of the ASCII characters including the alphabets, numeric characters, or special characters. These are used to secure the accounts on different platforms such as social media or user accounts on the computer. 

Debian 12 allows the users to create multiple accounts for its different users and also enables them to secure their accounts with passwords. This way every user on Debian 12 can secure its account with their unique passwords. 

This post will explain different methods to change the password on Debian 12 by both, the terminal and GUI methods. The outline of this article will be as:

  1. What are the Methods to Change a Password on Debian
  2. Method 1: Change a Password on Debian Using the Terminal
  3. Method 2: Change a Password on Debian Using the GUI 

What are the Methods to Change a Password on Debian?

When the user accounts are being created, it suggests the users set a new password instantly or when the account is logged in for the first time. 

After this when the user wants to change the password of their account, two different methods can be used which are explained in detail in the next sections. 

Method 1: Change a Password on Debian Using the Terminal

Debian provides multiple command utilities to perform different tasks on the Debian. Following this, Debian allows its users to manage the passwords of the user accounts with the passwd command utility. 

To explore the usage of the passwd command utility on Linux distributions, users are requested to go through the mentioned post

Follow the next mentioned steps for changing the passwords on Debian 12 using the terminal. 

Step 1: Open the Terminal 

The first step is to launch the terminal by using the different steps mentioned in the blog:

Step 2: Display the Status of the Set Password

Now first find out the status of the currently set password by running the command:

$ sudo passwd -S

The above command shows that the password is being set up for the root user account. The “P” option shows that the password is set and is set up on 20th November 2023. The min age and the max age of the password in terms of days are 0 and 99999 respectively. The next number, 7 shows the number of days before the expiry date to generate the warning message to change the password. The last number “-1” shows the number of days after which the password expired on disabling the account. 

Step 3: Change the Password on Debian

To change the password of the current logged-in user, run the command:

$ passwd

Enter the current password of the “itslinuxfoss” user:

Now type the new password which is supposed to be set on the computer:

To confirm the new set password, retype it and press the ENTER key:

The password has been updated to the new password successfully. 

Step 4: Confirm the Status of the Password

To confirm the status of the new password, again run the command:

$ sudo passwd -S itslinuxfoss

The password has been changed successfully as its change date is today. 

Method 2: Change a Password on Debian Using the GUI 

Another method to change the password on Debian is by using the graphical user interface. This method is convenient for beginners of Debian as it requires no command to be executed. 

To change the password using the GUI, first open the “Settings” of Debian as shown:

Now scroll down the menu and click on the “Users” as shown:

Click on the “Unlock” option to make the setting accessible:

Enter the current password and click on the “Authenticate” option:

Now click on the “Password”:

First type the “Current Password”, then set the “New Password” and retype it to confirm the new password as shown below. Finally, click on the “Change” button as shown below:

The green bar is the indication that the strong password is being set up successfully. 

Conclusion

To change the password on Debian 12, either open the terminal and run the “passwd” command or open the settings and change the password of the users. 

The changing of the password after a specific time is recommended as it enhances the security of the system.

Both mentioned methods of changing the password on Debian have been explained in the step-by-step guide in this post.