Solve the problem that only guests can enter the system after changing 1000 in the /etc/passwd file to 0

one,

Before entering the topic, I will introduce several main editing commands of the vi editor here, I think I will use them in a while. (I don't regret not learning unix well at the beginning)

The most important point is to know that the vi editor is divided into editing mode and command mode. Press the esc key to enter the command mode from the editing mode, and press the i key to enter the editing mode from the command mode. (If you really can't tell what mode it is, just press esc a few more times.)

If you want to save or exit into the command mode, you must start with a ":", for example:

:w to save without exiting the editor

:q! force quit

:wq! save and exit

x is to delete one character backwards

dd deletes the entire line where the cursor is located

 

Second, the solution

(1) Restart the computer and long press ctrl+alt+fi to enter the command line mode (actually the same as the terminal)

(2) Then log in to your account and enter your account password (this time you are a root user and need to enter the root password you reset)

(3) Since you are the root user (if you don't hit: sudo su, right), you have read and write permissions to the files under root

Enter: vi /etc/passwd to enter the vi editing mode of the file

(4) Use the above vi editing command to change 0 back to 1000 and save it, so that if you restart, you will still enter guest mode.

It is best to modify the /etc/lightdm/lightdm.conf file (according to the method in the previous article)

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326850720&siteId=291194637