Note record | Ubuntu16.04 set default root user login

0 x00 Set password for root user

dora@ubuntu:~$ sudo passwd root
[ sudo] password for dora:
Enter newUNIX password:
Retype newUNIX password:
passwd: password updated successfully

0 x01 Modify 50-ubuntu.conf configuration file

sudo gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

Add the following content to the file

autologin-user=root
greeter-session=lightdm-gtk-greeter

0 x02 Modify .profile file

sudo gedit /root/.profile

Add tty -s && at the beginning of the last line of the original file, like this

# ~ /.profile: executed by Bourne-compatible login shells.if["$BASH"]; then
 if[-f ~/.bashrc ]; then
 .~ /.bashrc
 fi
fi
tty -s && mesg n ||true

0 x03 Restart the system

After restarting, it is the default root user


Recommended Posts

Note record | Ubuntu16.04 set default root user login
Enable root user remote login on ubuntu system
ubuntu root default password (initial password)
Tencent Cloud Ubuntu 18.04 open root login
Wsl sets the default account to root (ubuntu18.04)
How to change root user password on Ubuntu
Tencent Cloud ubuntu system changed to root login
ubuntu cycle login
Ubuntu installation record
Ubuntu 14.04 configuration record
Modify the default root password of the Ubuntu operating system