dora@ubuntu:~$ sudo passwd root
[ sudo] password for dora:
Enter newUNIX password:
Retype newUNIX password:
passwd: password updated successfully
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
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
After restarting, it is the default root user
Recommended Posts