Login as root on ubuntu desktop

8,304
  1. Set a root password (may be the same as user password) with sudo passwd root. You'll be asked to type the password twice in case of a typo.
  2. Unlock the root account with sudo passwd -u root.
  3. Edit sudo nano /etc/gdm3/custom.conf, and add the following line under [security]:
AllowRoot=true
  1. Edit sudo nano /etc/pam.d/gdm-password, and comment out the following line by adding a # in front of it, like this:
#auth   required    pam_succeed_if.so user != root quiet_success
  1. Reboot.
  2. Select "Not Listed" at the login screen, then type "root" in the username field, and your root password in the password field.
  3. Now you should be logged in as root in your GUI desktop.
Share:
8,304
Majoris
Author by

Majoris

Updated on September 18, 2022

Comments

  • Majoris
    Majoris almost 2 years

    How do we turn on root desktop login? I set the root password then modified /etc/gdm3/custom.conf

    [Security]
    AllowRoot=true
    

    This is not giving me the option of the root at login screen, neither it accepts my root credentials. Credentials are correct.

    • FedKad
      FedKad over 4 years
      Did you try putting a new file called root to the directory /var/lib/AccountsService/users similar to your other normal user? (Note that there should be present a line like SystemAccount=false in the [User] section.)
    • Rinzwind
      Rinzwind over 4 years
      please install a Linux that is designed for using root and is enabled by default. Ubuntu is designed as a sudo based system for a reason: to prevent mistakes
  • BrianBlaze
    BrianBlaze almost 3 years
    It's so frustrating I had to do this to run anything on this ubuntu machine that on any other ubuntu installation would ask me for authentication to open an application. For some reason it won't ask me so nothing will open or mount if it needs root password. Thanks for the work around.