Change root password in Linux (sudo passwd root)

This is the command to set root password so that we don’t have to type

$sudo su
to change to root user.
Just type the following command and u can login as root as
please follow the commands below :———–

manohar@manohar-desktop:~$ sudo passwd root
[sudo] password for manohar:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
manohar@manohar-desktop:~$ su

In this way u can change root password…

Please post a comment if u liked it or have further query…

I am Manohar Bhattarai, a vivid java programmer. I am a keen Linux user. I currently boot Ubuntu Linux. I am a Free/Libre Open Source Software enthusiast.

Posted in Linux, Ubuntu Tagged with: , , , , , , , , , , , , , , ,
10 comments on “Change root password in Linux (sudo passwd root)
  1. ari says:

    Hi, I yipe

    sudo passwd -l root

    In terminal. Now, I am not asked password each time I type sudo. How to set it to default? it seems not really secure.

  2. lim says:

    hi, thx for showing this but i still cant go thru it…. from 2nd stage… i cant type passwd for sudo… press all they key also cant key in

  3. José says:


  4. Joseph Busich says:

    any idea how to make it so that only person with sudo can run the command sudo passwd……i have a vpn server setup with 2 other sudoers and i want to be the only one that can change the root password and access root

  5. Patrik says:

    UR Awesome !!!

  6. ranjan raj says:

    excellent dude

  7. Eddie says:

    YOURE AWESOME DUDE THANKS SO MUCH!!!! 10000000 times better than any other site i have tried

  8. anand says:

    hi, i lost the password for root, i dont have any other administrator account. how to reset root password

Leave a Reply