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
|Requirements, Conventions or Software Version Used
|Any Linux distro
|GNOME desktop environment
|Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
GNOME login as root step by step instructions
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.
- First, we need to set a password on the root user account. Most distros these days just have normal user accounts use
sudowhen 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.
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
- Now you may log out of your current account in order to return to the login screen.
- 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.
- Enter your username, in this case
root, and the password to finish logging into GNOME GUI with the root account.
- 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.
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.