The last time I encountered this problem, my friend encountered this problem again today. By the way, I recorded that the last time we encountered a problem on our server, I lost the entire user of linuxroot, at that time, I found an article on the Internet, and it was restored. today, I would like to sum up again: Restart the server and enter the single-user mode. if the entire root is lost, I will recreate the root user, command: useradd-u0-g0-d/root-s/bin/bashro
The last time I encountered this problem, my friend encountered this problem again today, I recorded it by the way:
The last time we encountered a problem on our server, the linux root user was lost. at that time, I found an article on the Internet and restored it. today I will summarize it again:
Restart the server and enter the single-user mode. if the entire root user is lost, re-create the root user. the command is as follows:
Useradd-u 0-g 0-d/root-s/bin/bash root
Create root
-U 0-g 0 specify the root uid gid as 0
-D/root: specify the root directory as/root.
-S/bin/bash specifies the root bash
Passwd root
Reset password
Restart