Unable to enter the system because the system file passwd was moved accidentally.
After logging in to the system, execute mv /etc/passwd /root/start.tomct (move the system passwd file to the root root directory and rename it).
At this time, the passwd file has been moved To other locations, this is that after we execute the restart command, we cannot enter the system here.
After reboot, it will be stuck on the startup page and
press Esc to view the details and find an error
Solution:
We physically restart the server, and enter the edit mode when booting
Move the cursor down to
find the position at the beginning of ro in this line,
modify it to rw init=/sysroot/bin/sh
ctrl+x to execute, enter the single-user mode interface,
execute chroot /sysroot
CD to root and see the password file just moved, At this time, we execute the mobile code to move the password file back to
mv /root/start.tomct /etc/passwd
or
cp /root/start.tomct /etc
mv start.tomct passwd After
modifying the password, create the file
touch /.autorelabel
After execution, physically restart the server and exit the single user mode.
After entering the system again, you can log in to the system with the original password