Setting a root password

One of the first things you would want to do after you install Ubuntu (i suppose any Linux distro) is to reset/set root password. Yes you can get around all this using “sudo” command. But it will be a real pain one you start doing a lot of things that need authorization.

Just type “su” into your terminal window and you can become root provided you know the password. In most cases this will not be known to you. Here’s how you can set it..

Step 1: Applications>Accessories>Terminal  (or you can press Ctrl+Alt+T).

You will be prompted with your_name@your_computer_name:~$ . This means you are working in “/home/your_name” and you are you and not root. :) Never mind.

Step 2: Type sudo passwd root. It should look like this:

$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:

And if everything goes well,

passwd: password updated successfully

Thats it. once you type “sudo passwd root” and hit enter, it will ask for your password. Type in the password you want to use for root. I dont have to tell you not to forget it. Retype it and we are done. Yes you wont see anything there while you type. Thats how it is. You will get used to it as we go along.

This works for resetting the password too at a future time. I guess if you are in sudoers list, you can reset anyones password. Instead of “root” after “sudo passwd”, type in the username. Try it out. Reset your brothers password and let me watch him kill you. ;)

About Manu Mohan

Just another 20yr old...With a screwed up college life and feels hes doesn't fit in..:)

Posted on September 20, 2011, in Linux Adventures, Ubuntu and tagged , , , , , , . Bookmark the permalink. 6 Comments.

  1. Hey, what’s the difference between using root privileges with “sudo -i” and the one you stated above? Do we need to go to all that trouble? “sudo -i” works fine with your user password.

  2. Image, Click to view

    Just like that, one day sudo will tell you that and we will use su. :)

    On a serious note, i dont think sudo and su makes any difference in a single user enviornment. But in a multi user enviornment where one is admin and the rest just regular users not in the sudoers list, the regular user can use su and be root once and for all(with in the terminal instance)provided he knows the root password.

    But it feels nice to enter the root password and all. Doesnt it? ;)

  3. Haha…yeah well..they dont deserve to know…

Cracking your skull open while you hit it on the desk? Let me know about it...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: