In fact, I only now know that the Linux system has stricter user rights management. Under Ubuntu, the system does not allow users with root privileges to enter the graphical interface system. Because I didn't get permission before, this thing fell into the pit instantly.
I want to modify the nginx.conf file under root, but I don't have permission, so I want to solve this problem once and for all, so I think of the user's permission.
The steps I changed are as follows:
(1) First enter the root user in the terminal: sudo su
(2) Then set the root password: passwd root, enter the root password, and confirm the root password.
(3) Enter the command in the terminal: sudo gedit /etc/passwd to open the /etc/passwd file with root user privileges and modify it. (Actually, I want to open nginx.conf and use this, why bother so much)
(4) Find your username at the bottom of this file and change both 1000:1000 to 0
For example, mine is zhouchang: x: 1000: 1000
After the modification, zhouchang will be established: x: 1:1
(5) Save and log out and then I have a tragedy. I can only log in as a guest. In fact, this is still missing a key part:
(6) Terminal open: sudo: sudo gedit /etc/lightdm/lightdm.conf
Change the content of this file to:
[seatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
greeter-show-manual-login=ture (this command allows you to enter your account when entering the interface, so that it will not be accessed by the default guest)
allow-gues=false (this command does not allow guest login)
Advice: I hope that the general public is best not to change the /etc/passwd file blindly.
I can't access my account now and can only solve it by another method.