Home > Article > Operation and Maintenance > How to reset the remote password of a Linux cloud server
Return to the directory
1. When the GRUB version selection interface appears, press the Esc key immediately. Otherwise, the system will continue to start and cannot proceed to the next step.
#2. Select the first kernel and press the e key to enter the editing interface.
#3. Find the line where the first word is linux, and change ro in this line to rw init=/sysroot/bin/sh. Then press the Ctrl X key to start the system in single-user mode.
#4. After the system starts, enter chroot /sysroot to enter the system.
5. Use the passwd command to reset the password.
#6. Relabel the file system, then exit and restart the system.
touch /.autorelabel exit logout reboot
#7. After the system starts normally, you can successfully log in with the new password.
Return to the directory
1. The first 5 steps are exactly the same as the steps for resetting the password on CentOS 8. Only the content of the kernel file is different.
#2. After resetting the password, enter reboot -f to force restart the system.
#3. After the system starts normally, you can successfully log in with the new password.
Return to the directory
1. When the Booting CentOS... prompt appears, press any key immediately to enter the kernel selection interface. Otherwise, the system will continue to start and cannot proceed to the next step.
2. Select the first kernel and press the a key to prepare to modify the kernel parameters.
3. Enter the single character at the end of the line and press Enter.
#4. After the system starts, use the passwd command to reset the password and restart.
#5. After the system starts normally, you can successfully log in with the new password.
Return to directory
1. During the system startup process, press the Esc key immediately to enter the kernel selection interface. Otherwise, the system will continue to start and cannot proceed to the next step.
2. Select the first kernel and press the e key to enter the editing interface.
3. Find the line where the first word is linux and add init=/sysroot/bin/sh at the end. Then press the Ctrl X key to start the system in single-user mode.
#4. After the system starts, enter mount -o remount,rw / to remount the system.
5. Use the passwd command to reset the password and force a restart.
#6. After the system starts normally, you can successfully log in with the new password.
Return to directory
1. During system startup, press the Esc key immediately to enter the kernel selection interface. Otherwise, the system will continue to start and cannot proceed to the next step.
2. Select the first kernel and press the e key to enter the editing interface.
3. Find the line where the first word is linux and add init=/sysroot/bin/sh at the end. Then press the Ctrl X key to start the system in single-user mode.
#4. After the system starts, enter mount -o remount,rw / to remount the system.
5. Use the passwd command to reset the password and force a restart.
#6. After the system starts normally, you can successfully log in with the new password.
Return to directory
1. When the GRUB version selection interface appears, press the Esc key immediately. Otherwise, the system will continue to start and cannot proceed to the next step.
2. Select the first kernel and press the e key to enter the editing interface.
#3. Find the line where the first word is linux, and change ro in this line to rw init=/sysroot/bin/sh. Then press the Ctrl X key to start the system in single-user mode.
#4. After the system starts, enter chroot /sysroot to enter the system.
5. Use the passwd command to reset the password.
#6. Relabel the file system, then exit and restart the system.
touch /.autorelabel exit logout reboot
#7. After the system starts normally, you can successfully log in with the new password.
Return to directory
1. When the system startup interface appears, press 2 to enter single-user mode.
#2. Use the passwd command to reset the password and restart.
#3. After the system starts normally, you can successfully log in with the new password.
The above is the detailed content of How to reset the remote password of a Linux cloud server. For more information, please follow other related articles on the PHP Chinese website!