Setting the desktop Linux boot automatically log in as root

1, allows the use of root user logon desktop
    Ubuntu by default does not allow root user login desktop, you first need to configure the following
    configuration editor to modify the file /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf as follows

[Seat: *]
the User-the session = Ubuntu
the Greeter-Show-Manual-the Login = # to true allows the user to log their own user name and password for
the root user in Ubuntu is no default password, so you need to set the root password

sudo passwd root # execute this command to change the root password in the current user's desktop login
[sudo] user password: # Enter the current logged-on user user user password
to enter a new UNIX password: # Enter a root password
to re-enter the new UNIX password: # enter the root password again
passwd: password successfully updated

2, allow root to start automatically logon desktop

    Edit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf again, add the following two lines at the end of the file

allow-guset = flase # forbid the guest user login
Autologin-user = root # specify the root user to automatically log on

    After editing is complete, still you need to modify the graphical desktop configuration, edit the file /etc/gdm3/custom.conf, find the [daemon] item, the following configuration changes to the

[daemon]
AutomaticLoginEnable = # to true to enable automatic login
AutomaticLogin = root # specify the root user to automatically log users

3, because Ubuntu is disabled by default using the root user to ssh remote login terminal access, so if you need to use ssh root login, then you need to add the following configuration file

PermitRootLogin yes

4, restart the computer to take effect

Compared with the system in Ubuntu, Redhat setup is relatively simple, just change the [daemon] /etc/gdm/custom.conf configuration file entries, to take effect after restart

[daemon]
AutomaticLoginEnable=True
AutomaticLogin=root

Guess you like

Origin www.linuxidc.com/Linux/2019-07/159692.htm