Enabling root login in ubuntu

Many of you must have noticed that root login in ubuntu is disabled in default. Even su doesnt work. The ubuntu documentation says that “ubuntu is shipped with root account is locked“. Actually its a good move. The newcomers to ubuntu do not want to get frightened hearing the name ‘root‘. If you have moved passed the n00b stage you might want to unlock it.
Firstly you should set the root password. Login to ubuntu with the user which you created during installation. Go to System> Administration> Users and Groups. Select root. Click on Properties. Set the root password.
Secondly enable the root login. Click on System> Administration> Login Window. Click on Security tab. Check “Allow local administrator login“. Click on OK.
Everything is done. Now logout and log in with your root account.

A Word of CAUTION: Use your root account only when absolutely necessary. Never user root account for daily works. For regular work use the account created at installation time.
Reason: Root is the superuser. It has got all the unrestricted privileges to perform any tasks. Its like “I can do anything“.
While running as normal user you would be prompted for your password when you try to make a major change to system settings. Thus you would be alerted that your step is making some changes if you are ignorant of the step you are taking.
A virus is a program or script that intends to harm your system by changing the settings or configuration. At that stage you would be prompted for password, thus you can get warned.

17 thoughts on “Enabling root login in ubuntu

  1. Hey,

    I am still having some problem.

    Click on System> Administration> Login Window. Click on Security tab. Check “Allow local administrator login“. Click on OK.

    I dont get a OK button, only close button is there, so the option is not set properly. 😦 I am a newbiee.. do you have any idea why this is happening.

    I am logged in as the user I created while installation.

    Your help will is highly appriciated.

    /Reza – there is always light at the end of the tunnel

  2. @Reza
    No problems, even if you get Close,it means that the settings are saved as you changed it. It can happen sometimes.

    Just try logging out and logging in again..

  3. Hey. I’m having problem with “System> Administration> Users and Groups”
    When I select ‘root’, I can’t press properties or any other button, so I still can’t get in my root account.
    What should I do?

  4. @Tn
    If you want to set your root password
    then use this command
    sudo passwd root

    It will ask you to set the new password for root.
    I hope you have enable root login

  5. can you tell me how to disbale the root login for x-manager , i mean only in GUI ( how ubuntu has) in other flavours like fedora or suse either in GNOME/ KDE?

  6. Can u pls tell me how to disable the root login in GUI in Fedora as Ubuntu has in its X -manager? , either in GNOME or KDM ?

  7. Hello everyone. my problems is a litle bit different. I’have disabled the adminitration permission to a normal user. Whatherver a forgot to enable the root login. Now I can not do that because my normal user have no permission. I had configure the root password before do that, so I can login with root in a terminal. Is that any command to use in console to get a graphical access to system configuration.

  8. For that reboot your system in recovery mode. First take the backup of the /etc/sudoers file by

    sudo cp /etc/sudoers /etc/sudoers.back

    Then type this command

    sudo echo “username ALL=(ALL) ALL” >> /etc/sudoers

    Here replace username with the name of the user whom you want to give sudo priviliges

    If the problem still persists restore the old sudoers file by

    sudo cp /etc/sudoers.back /etc/sudoers

  9. Hi Manish,
    I have a netbook handed to me with jaunty on it and no details about added users and passwords. I managed to get into a root shell and used the adduser script to add a non-root user, but its not in the sudoers list. Now problem is, I need root login/password to use visudo and I need sudo to enable the root account. Somehow the passwd command for the root account was failing saying “Manipulating Authentication token has failed. password unchanged”. Could you please suggest a solution out of this deadlock? I was following hxxp://www.ubuntu-inside.me/2009/07/howto-add-user-to-sudoers-list-on.html just so that you know. TIA

    1. You should boot into single user mode. Use the second option of GRUB when booting. I would drop you down to root shell.

      Now create the user you want. Set it’s password and then edit the sudoers file using visudo.
      Now reboot. sudo should be available if you login using that user which you created.

  10. hey,

    i have created password for root in userandgroups.after that what i have to do,im not getting loginwindow option,only login screen is there.if i go inside that it is showing only user name.how to go for login window and where it will be.

Comments are closed.