I have found a lot of solutions on the Internet to forget the password, but since I just got started, many of them are not very familiar with it, and some of them on the internet say too much about it, next, I had to read more books and find the answer. Now I can summarize the details as follows:
I will discuss how to use this method when logging on to the Linux system as a common user without knowing the password of the root account. If VI is used, you can easily enter VI/etc/passwd in the command line of the terminal logged on with a common account to open the file for saving the password, in the/etc/passwd file: the logon items in the password file are composed of seven fields separated by colons: Login Name, encrypted password, digital user ID, numeric group ID, comment field, start directory (/home/Steven S) and ShellProgram(/Bin/KSh ).
The above fields correspond to the following line in passwd:
Root: X: 0: 0: Root:/root:/bin/bash X is the encrypted password. If you delete this X root account, there will be no password, which is exactly the same: root: X: 0: 0: Root:/root: /bin/Bash: Save it again. For system security, please log on to the root account with or without a password and use the passwd command to set the password.