Setting the root password in Ubuntu

WARNING! Don’t use the root password just because; a) You can b) You’re too lazy to type sudo c) You feel a sense a pride and importance being the super-user

When you first installed Ubuntu, it didn’t ask you for a root password, there’s a good reason for this — you’re not supposed to use it, you are a danger to yourself and others when you are logged on as root.

However, there will be situations that you will really need the be root. Unfortunately in Ubuntu, you cannot login as root; (not just yet). If you need to use elevated privileges, you can use the sudo command, the sudo allows you to be some sort of root for a very brief time, just enough for you to complete the command, when the command finishes, you are no longer privileged.

If you still need to be root though, here are the steps.

Get a terminal , type ALT+F2 if you’re in Gnome then type xterm or gnome-terminal, then type.

$ sudo passwd root

Pay attention to the prompts, it will ask you twice for the new root password.

After this, you can now login as root during boot time. If you need to be root while still logged on as a non-privileged user, you can type $su , then enter the root password when asked, you can also be root using that procedure. By the way, you can use this technique also on other Linux distros.

If you want to show appreciation for my efforts dear reader, you could buy me a tall hazel nut Americano ($2) via PayPal. Thanks
| | | | .

{1 Comment below .. you can add one }


srhegde 7.10.2009at 04:35

For the non-command line guys, you can do it by “System->Administration->Users and Groups”. May be required to click on “Unlock” at the bottom of the window.

Leave a comment