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:
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
.
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
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.
You should read it
- How to use sudo without password in Linux
- How to Reset Admin Password on Mac OS X
- How to reset Admin password on Windows with Sticky Keys
- How to Use a Password Reset Disk (Windows)
- How to Reset a Forgotten Password on Windows
- How to fix the error of creating Password Reset Disk on Windows
- How to use Password Reset Disk to reset Windows password?
- Fix some errors when using Password Reset Wizard
- How to Reset a Lost Admin Password on Mac OS X
- How to retrieve a Tik Tok password when it is lost
- How to Reset a Windows 7 Password
- Create Windows Password Reset Disk on Windows 7 with USB Flash Drive
Maybe you are interested
4 Mistakes to Avoid When Setting Up a Password Manager
Are complex passwords 'out of date'?
5 Reasons People Prefer Password Login Over Email
If you're still using this insecure password method, it's time to stop!
This is the type of password that takes 34,000 years to crack
Should I choose a free or paid password manager?