How to reset the password for sudo in Debian

The user password is changed in Debian using the passwd command. In this article, TipsMake.com will explain how root users can change their own passwords on Debian servers.

If you are a new Debian administrator, you may want to know how to change the sudo password on a shell. After all, it's good to change your password regularly for any user, especially Super User, who can perform all sensitive operations on Debian. Only Super User or root can change the password for any user account. Other users can only change their own password.

The user password is changed in Debian using the passwd command.

In this article, TipsMake.com will explain how root users can change their own passwords on Debian servers.

Step 1: Open the Debian command line

You will need to use the Debian command line tool, Terminal, to change the sudo password. Open Terminal via the search for Application Launcher as follows:

How to reset the password for sudo in Debian Picture 1How to reset the password for sudo in Debian Picture 1
Open Terminal

You can launch the Application Launcher through the Super / Windows key on the keyboard.

Step 2: Log in as the root user

Only root users can change their own passwords. Therefore you need to log in as root first. Enter the following command to do so:

 $ sudo -i 

The system will prompt you to enter the current sudo password. Please enter the password and press Enter .

How to reset the password for sudo in Debian Picture 2How to reset the password for sudo in Debian Picture 2
Log in as the root user

You are now logged in as the root user (that is shown in the command prompt).

Step 3: Change the sudo password via passwd command

Now that you are logged in as root, you can change the passwd for the current (root) user by using the passwd command as follows:

 $ passwd 
How to reset the password for sudo in Debian Picture 3How to reset the password for sudo in Debian Picture 3
Change the sudo password through the passwd command

When you type the passwd command, the system will prompt you to enter a new UNIX root password. If you enter a new password and press Enter , the system will prompt you to re-enter the new UNIX root password. After you do so, the system will confirm that the password has been updated successfully.

Now, whenever you need to log in as root or perform any installation and configuration that requires root access, you will use this new password.

Step 4: Exit the root login and then Terminal

When you have finished changing the password, you can exit the root login by entering the following command.

 $ exit 

Once you're logged out, retype the exit command to exit the Terminal application.

Alternative method

Alternatively, simply enter the following command to log in as root and change the password:

 $ sudo passwd root 

When you enter the above command, the system will prompt you to enter a new UNIX root password. When you enter a new password and press Enter , the system will prompt you to re-enter the new UNIX root password. After you do so, the system will confirm that the password was updated successfully.

3.5 ★ | 2 Vote