How to set root password on Ubuntu / Debian / Linux Mint

FAQ : How to set root password on Ubuntu / Debian / Linux Mint Operating system ? How may I also check , the root password is working ?

Answer: Ubuntu is Debian based operating system. Whereas Linux Mint is based on Ubuntu and Debian both.

Set / reset root password on Ubuntu / Debian / Linux Mint

The steps are similar in Ubuntu,Debian and Linux Mint. It is also applicable to other Linux distro which are based on Debian/Ubuntu.

Step 1: Login into the system with system user name. For example, here the system username is “sharad

Step 2: Now set the root password.
Use the below given command to set/reset the root password.
First give the password of system user by which you log in.
Then, type root password as per your desire.Hit enter and reconfirm the password.

Note: When we set user password, it is always invisible.Hence, confidently set the password and hit enter

sharad@ubuntu:~$ sudo passwd root
[sudo] password for sharad: 
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
sharad@ubuntu:~$

Now with above command the root password is set.

How to check root password is working

When you set the password in Ubuntu,Debian and Linux Mint , you can check root password by directly login from command terminal.

I believe, you are still log in with system user.Here, we are still login with username called “sharad”

Use the below given command and give root password which you have set in above section

su -l root

The below given is reference from my system

sharad@ubuntu:~$ su -l root
Password: 
root@ubuntu:~# 
root@ubuntu:~# whoami
root
root@ubuntu:~#

5 thoughts on “How to set root password on Ubuntu / Debian / Linux Mint”

  1. Hi, I try to set root passwd but when it comes to typing in the UNIX passwd the keyboard will not type the letters. Any ideas? I am running Mint 19.2 64 bit processor. I had no problem setting passwd on my 32 bit system using the same operating system.
    Many thanks

    Reply
    • Banana, read the post attentively.

      Note: When we set user password, it is always invisible.Hence, confidently set the password and hit enter

      Reply
    • LOL! That was probably my comment up there, Anyway, the system seems to have forgot my password, or I didn’t write it down correctly, but now I have a new one. Thank you.

      Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.