enable root login in ubuntu 18.04

Ubuntu 18.04 comes with GDM ( Gnome Display Manager ) as a default Display Manager instead of LightDM ( Ubuntu older version comes with this ).
For Security reason user can’t login with root user. For development and advanced operation user need to login with root.
Steps to enable root login Ubuntu 18.04 .

Login  Ubuntu using your username and password.

  • Open terminal ( shortcut press cnt+alt+N).
  • Type sudo -i and then type your password. This will grant temporary root access (terminal charged form $ to # )
$ sudo -i
  • Now set root password type below command this will ask you to enter root password.
# passwd root
  • Now modify GDM configuration file to allow root.
# gedit /etc/gdm3/custom.conf

Just add two line below [Security]

          AllowRoot = true
          AllowRemoteRoot = true
  • Now modify PAM (Pluggable Authentication Modules) configuration file.
# gedit /etc/pam.d/gdm-password
  • Comment or remove below line on this file (For comment add # at the beginning of line) and save it.
auth required pam_succeed_if.so user != root quiet_success
# auth	required	pam_succeed_if.so user != root quiet_success


  • Now reboot Ubuntu 18.04  system and login with root user.


  • This video shows live demonstration , please watch this video first

Leave a Reply

Your email address will not be published. Required fields are marked *