How to Login as a root user in Ubuntu 10.04

The following steps are very simple and especially for newbies who are completely new to Linux. 🙂 By logging in as root user, you are making your operating system more vulnerable. Root user has all the administrator privileges so whenever you need to edit system files or configuration from within Gnome, you will feel the need to login to Ubuntu as a root user. There are 2 methods to login as a root user

  • Graphical Method (GUI Method)
  • Command Line Method (CLI Method)

Method 1: GUI Method

Following are the steps to be followed to login as a root user in GUI Mode,

  1. Go to Applications -> Accessories -> Terminal
  2. Type: sudo passwd root
  3. Enter your password of the current user
  4. When you see the prompt that says “Enter new UNIX password”, enter the password you want for the root userand confirm it. [My suggestion is to assign its pswd as “root”]
  5. Type exit to exit the terminal
  6. Restart Ubuntu and wait for the login screen to appear
  7. Click other.. and type User name : root and Password : root

This should work fine and you are done.!

Method 2: CLI Mode

Following are the steps to be followed to login as a root user in CLI Mode,

  1. Go to Applications -> Accessories -> Terminal
  2. Type sudo su (Meaning: superuserdo superuser)
  3. Now you are into root dircetory, You may modify whatever you wish from here if you are familiar with commands.
  4. NOTE: You can also login into other Users from root directory via terminal window by typing the following command login username and Password of the corresponding User you wish to login.
  5. Use the above method with Caution.Read this post for assistance https://help.ubuntu.com/community/RootSudo

Note: Always take a backup of the file  that you wish to alter, so that you may set them back if anything went wrong.

3 Comments

Balaji July 20, 2010

IT IS HIGHLY RECOMMENDED DONT ENTER AS ROOT USER through first method as given by the author, “especially for newbies” lines should be changed..newbies shouldnt enter as “root” as it is highly vulnerable.
second method can be used,”sudo” method is not actually having all root privileges but it can be used for most of the operations to act as like “root” and it is only recommended

Jeyanthan July 21, 2010

Thanks for your update Mr.balaji.
I admit your point. I thought that It’s understood and herewith I’d like to caution readers that they are doing it by your own risk !.

venkat August 10, 2010

if the user don’t want to give password every time while using “sudo” they can add the below command in the terminal.

echo ALL=NOPASSWD: ALL >> /etc/sudoers