1. Use: sudo passwd root to set the root password, as shown in the following figure:
2. Use su root to test whether you can enter the root user. If # appears, the password of the root user has been set successfully, as shown in the following figure:
3. Go to the /usr/share/lightdm/lightdm.conf.d/ directory and use the gedit 50-unity-greeter.conf & command to open the 50-unity-greeter.conf file, as shown in the following figure:
4. Add the following information in the open file to set the user to log in when logging in, as shown in the following figure:
user-session=ubuntu
greeter-show-manual-login=true
all-guest=false
5. Restart the system, and the input user name information will appear, as shown in the following figure:
6. Enter the root user name and password, as shown in the following figure:
7. At this point, an error will appear when reading /root/.profile, and a dialog box will appear, as shown in the following figure:
8. Click the OK button to enter the system, use the vi /root/.profile command to modify the file, find mesg n, and modify it to: tty -s && mesg n, as shown in the following figure:
9. Save and exit, and then restart the system.