[Linux]Auto login with root account

 

Redhat7.4 OS:

gedit /etc/gdm/custom.conf

[daemen]

AutomaticLoginEnable=true
AutomaticLogin=root

 

SUSE 12SP3 OS:

gedit /etc/sysconfig/displaymanager

DISPLAYMANAGER_AUTOLOGIN=’root’

 

Ubuntu 17.10 OS:

Step 1:Enable root account and set the password

sudo passwd root

Step 2: Allow to login with the root account

cd /etc/pam.d/

sudo chmod 777 gdm-autologin //  change back its right for writing

sudo chmod 777 gdm-passwd    //  change  its right for writing

 

gedit gdm-autologin                  //use ‘#’ to diable this line


#auth required pam_succeed_if.so user != root quiet_success 


 

gedit gdm-passwd                  //use ‘#’ to diable this line


#authrequired pam_succeed_if.so user != root quiet_success     


 

sudo chmod 644 gdm-autologin     //  change back its right

sudo chmod 644 gdm-password//  change back its right

Step 2: configure the auto login function

cd /etc/gdm3/

sudo chmod 777 custom.conf

gedit custom.conf  //add the auto login info under [daemon] tab


[daemon]
AutomaticLoginEnable=true
AutomaticLogin=root


 

sudo chmod 644 custom.conf

Step 3: reboot system