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:
- Open the terminal and type:
sudo passwd root
- When you see the prompt that says "Enter new UNIX password", enter the password you want for the root user and confirm it.
sudo gedit /etc/X11/gdm/gdm.conf
- Locate the line that says "AllowRoot=false". Change it to "AllowRoot=true".
- Save the file
- 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.