GNOME login as root

In this tutorial, you will see how to enable root login for the GNOME desktop environment on a Linux system. By default, users are expected to log in to the GNOME desktop environment using a normal account. This is a recommended practice due to security concerns. If you wish to ignore this recommendation and log in to GNOME with the root account, keep reading below.

In this tutorial you will learn:

  • How to enable root login for GNOME GUI
  • How to log into root account on GNOME
GNOME login as root
GNOME login as root
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Linux distro
Software GNOME desktop environment
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

GNOME login as root step by step instructions



Twitter icon Follow LinuxConfig.org on Twitter for the latest tips and tricks about Linux!


The process for enabling root login in the GNOME desktop environment will vary slightly depending on which Linux distribution you are running. Follow the step by step instructions below to log in to the root account on GNOME.

  1. First, we need to set a password on the root user account. Most distros these days just have normal user accounts use sudo when they need elevated privileges, and leave the root account without a password. We will need to set a password in order to log in with the root account later. Open a command line terminal and execute the following command.
    $ sudo passwd
    

    You will be prompted to enter a password twice. This will be the new password for your system’s root account.

  2. NOTE
    Note that this next step is only necessary if you are running a Debian based Linux distribution, such as Debian Linux, Ubuntu Linux, Linux Mint, etc.

    Use nano or your preferred text editor to open the following file with root permissions.

    $ sudo nano /etc/pam.d/gdm-password
    

    Then find the line below and comment it out (put a # in front of it) and save your changes to the file when done.

    auth required pam_succeed_if.so user != root quiet
    
    Updating the gdm-password configuration file to allow root login for GNOME
    Updating the gdm-password configuration file to allow root login for GNOME
  3. Now you may log out of your current account in order to return to the login screen.
    Log out of GNOME desktop environment
    Log out of GNOME desktop environment
  4. At the login prompt, click on the little text that says “Not listed?” in order to specify a different user account than the usual one you log in with.

    Click on the text that says 'Not listed' at the GNOME GUI login screen
    Click on the text that says ‘Not listed’ at the GNOME GUI login screen



  5. Enter your username, in this case root, and the password to finish logging into GNOME GUI with the root account.
    Enter root for the username in GNOME GUI login screen
    Enter root for the username in GNOME GUI login screen
  6. Each time you log in to the GNOME GUI with the system’s root account, you will see a small notification to let you know that this is not a recommended practice, just like we mentioned earlier. This warning can be ignored (if you know what you are doing) and will go away quickly so it will not bother you.
    The GNOME desktop environment warning that logging in with root is not advisable
    The GNOME desktop environment warning that logging in with root is not advisable


Closing Thoughts

In this tutorial, we saw how to log in to the GNOME desktop environment with a root account on a Linux system. In order to do so, we needed to set a password on the root account, and, on Debian based distros, enable a setting in the GNOME Display Manager configuration file. Keep in mind that this is not a recommended practice and you should still try to use your normal account to log in to the GUI whenever possible.



Comments and Discussions
Linux Forum