How to Login to Ubuntu as Root User?

At times where Linux provides a secure and healthy environment for users, it makes other things even more complicated and intricate. Despite being such a user-friendly operating system, it is not that easy to login to Ubuntu as a root user.

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. But the question is here is “How to login to Ubuntu as a root user?”

Just follow the steps below:

  1. Open the terminal and type:
    sudo passwd root
  2. When you see the prompt that says “Enter new UNIX password”, enter the password you want for the root user and confirm it.
  3. Type:
    sudo gedit /etc/X11/gdm/gdm.conf
  4. Locate the line that says “AllowRoot=false”. Change it to “AllowRoot=true”.
  5. Save the file
  6. Exit gedit, logout and then reboot.

I used the same method when I wanted to login as root user to edit configuration files of my graphics card and everything worked great. However the only issue in this case is that by logging to Ubuntu as root you are making your operating system more vulnerable.

For Ubuntu users it is recommended to use the account which they created on time of install and use the “sudo” command while in terminal to execute commands as root user.

Comments

Bad bad bad idea, really.

Never run X with root’s power, there isn’t a reason to do that. If you need to configure something as root-root use sudo properly: ’sudo -i’

I aggree that you should not login to X as root. But Ubuntu style to use sudo is very bad bad bad idea too. If you always login using user who has sudo rights it’s even more dangerous than to login as a root.

Michael on Apr 20, 2008

You say to edit the gdm.conf file to allow root log in. Well you can edit the “Log In Window” settings under the System > Administration menu you to do this easier. Under the “Security” tab enable “Allow local system administrator log in”.

I agree with Michael’s idea
It worked.

  1. Best of April, Killer Links #2 and some more news!

    May 1, 2008

  1. Sizlopedia Tech Talk (April 2008)

    May 2, 2008

Leave a Comment

Name: (Required)

E-mail: (Required)

Website: (Optional)

Comment: