Sunday, November 25, 2012

How To Enable root (SuperUser) In Ubuntu 12

If you are a new linux user , you might wonder why sometimes linux don't let you to something in the GUI mode or in the terminal. This feature is for higher security and you need to login as "Super User" to run those specific command. The easiest way is to put "sudo" before any command you want to run then it will ask for your password and run the command. But what if you like to do something as SuperUser in GUI?? for this purpose you need to login as "root".
root user is not enabled by default in Ubuntu and you cannot go to super user mode by running "su" command.Before enabling "super user mode" if you run "su" you will see this error message "su: Authentication failure".

Warning: by logining as root you might put your computer at risk and enabling root is not recommended.

Enabling SuperUser account password:
First you need to choose a password for your root account. run below command, then it will ask for a password for root user and verify password.

server@ubuntu:~$ sudo passwd root
[sudo] password for server:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Now you can go to SuperUser mode by running "su" command.

suserver@ubuntu:~$ su


Disabling SuperUser account password:

If you decided to disable root user just run the following command in the terminal.

suserver@ubuntu:~$ sudo passwd -l root

Enabling root Login in GUI welcome page:

Now if you decided to login to Ubuntu GUI mode by root user , you need to enable "LOGIN" section in the welcome page of Ubuntu. We assume you already enabled the superuser from above tips.
run following command in the terminal:

sudo sh -c 'echo "greeter-show-manual-login=true" >> /etc/lightdm/lightdm.conf'

now restart your computer , after your computer bootup you have to see something similar to following image, in this section click on Login and enter root as username and press enter now enter your superuser password.

Social Networks Sharing