How to reset the password for sudo in Debian

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 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 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 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

May be interested

  • How to retrieve a Tik Tok password when it is lostHow to retrieve a Tik Tok password when it is lost
    tik tok password can be retrieved via email or via phone number registered tik tok account, when users forget or lose the password tik tok.
  • Top 5 easiest ways to reset Windows 10 computer passwordTop 5 easiest ways to reset Windows 10 computer password
    knowing simple and effective ways to reset your computer password will help you easily escape the nightmare of resetting your laptop when you forget your password.
  • How to Reset a Windows 7 PasswordHow to Reset a Windows 7 Password
    if you've forgotten your windows 7 password, you'll need to reset the password for your user account in order to log in. your windows 7 password can be reset by the network administrator if your computer resides on a domain, or can be...
  • Create Windows Password Reset Disk on Windows 7 with USB Flash DriveCreate Windows Password Reset Disk on Windows 7 with USB Flash Drive
    in the following article, the network administrator will guide you through the basic steps to create a password recovery tool - windows password reset disk with a usb drive on windows 7 operating system in case if you forget the login password. enter, you can still access your computer and create a new password.
  • Ways to reset BIOS password or remove BIOS passwordWays to reset BIOS password or remove BIOS password
    clear the bios password, set the bios to default mode in case you forget the bios password, buy an old device without knowing the bios password, here are ways you can use it.
  • How to Reset Router PasswordHow to Reset Router Password
    after resetting your router password, you will be able to log in and make the necessary changes or customizations. the only way to reset the router password is to restore factory settings by pressing the reset button right on the device.
  • 3 ways to reset lost Mac password3 ways to reset lost Mac password
    forgetting your mac's admin password means you will no longer have access to your mac. but there's no need to worry because it's possible to reset your mac's password and regain access by entering some other details.
  • Instructions to reset Netflix account passwordInstructions to reset Netflix account password
    when users forget their netflix account password, you need to reset the netflix account password to retrieve the password, then proceed to change the netflix password as you like.
  • How to reset WSL user passwordHow to reset WSL user password
    windows subsystem for linux, commonly known as wsl, is a feature that allows users to run supported linux distributions in windows. unlike dual boot, wsl runs inside windows like a regular windows application.
  • 7 free Windows password recovery tools7 free Windows password recovery tools
    the main function of the password recovery tool is to recover the passwords that users or administrators use when logging in to windows. these tools are often known as 'password stealing' tools because sometimes they are used by hackers to 'crack' user passwords.