How to allow GUI root login on Ubuntu 20.04 Focal Fossa Linux

In this article you will find out how to allow the root user to login to GUI gnome Desktop on Ubuntu 20.04 Focal Fossa.

In this tutorial you will learn:

  • How to set root password
  • How to configure GDM to allow root gui login
  • How to configure PAM to allow root gui login

Allow GUI root login on Ubuntu 20.04 Focal Fossa Linux Desktop

Allow GUI root login on Ubuntu 20.04 Focal Fossa Linux Desktop

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa
Software N/A
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

Allow GUI root login on Ubuntu 20.04 step by step instructions

  1. First step is to set root password:

    $ sudo passwd
    

    The above command will set a root password which will be later user to login to GUI.

  2. Next, step is to edit the /etc/gdm3/custom.conf GDM configuration file to allow root login.
    ALTTEXT

    use your favourite text editor and as a root user edit the /etc/gdm3/custom.conf file to add the AllowRoot=true line.



  3. Next, edit PAM authentication daemon configuration file /etc/pam.d/gdm-password and comment line which denies root access to graphical user interface.

    To do so edit file /etc/pam.d/gdm-password and put # in front of the line containing:

    auth   required        pam_succeed_if.so user != root quiet_success
    
    Comment line which denies root's access to graphical user interface

    Comment line which denies root’s access to graphical user interface

  4. All done. Reboot your Ubuntu system.
    enter root's credentials

    Upon a new login select Not listed? and enter root’s credentials.