Rescue Mode & Single User Mode

rescue mode

Rescue mode is a special boot mode used in Linux operating systems for troubleshooting and repair. It can provide some basic system functions so that the system can be diagnosed and repaired when problems occur.

Rescue mode typically loads minimal system resources and drivers to ensure that it can still boot normally in the event of a system failure. It also provides troubleshooting tools such as file system checks, network configuration, disk partitioning and repair, password reset, and more.

Rescue mode is typically used in the following situations:

  1. The system does not start properly, such as a boot error or major file corruption.

  2. The file system or disk must be repaired or checked.

  3. The system password needs to be reset or changed.

  4. A network configuration change or network connection problem needs to be fixed.

In conclusion, Rescue Mode can help you troubleshoot and repair when something goes wrong with your system, so that you can restore normal system operation as soon as possible.

single user mode

Linux single-user mode is a boot mode similar to rescue mode, but the difference is that it only loads a user-level operating system instead of a full system. In single-user mode, the system loads minimal system resources and drivers, and only starts a root user shell.

Single-user mode is typically used in the following situations:

  1. The file system or disk must be repaired or checked.

  2. The root user password needs to be changed.

  3. Need to troubleshoot and fix when something goes wrong with the system.

To enter Linux single-user mode, you can do the following:

  1. Press the Esc or Shift key at startup to enter the GRUB boot menu.

  2. Select the kernel to boot and press e to edit the boot configuration.

  3. Change the "ro" (read-only) option to "rw" (read-write).

  4. Add "single" or "1" to the end of the options and press Enter to save the changes and start the system.

The system will boot into a root user shell in single-user mode. From this shell, you can perform required troubleshooting and repair operations, such as changing passwords, checking filesystems, resetting configurations, and more. When finished, you can use the "exit" command to exit single-user mode and reboot the system.

Start the instance:

Restart the server machine

 

In the first option of the grub menu, press e to enter the user name and password

Enter the user name root and press Enter, then enter the password Kylin123123 and press Enter

Then use the arrow keys on the keyboard to find and place the cursor at the beginning of the line at the beginning of linux

Change ro to rw and enter init=/bin/bash console=tty0 at the end of the line

Then press the shortcut key Ctrl X on the keyboard at the same time (these two shortcut keys must be pressed together,) 

Then enter the command mount –o remount, rw /   enter (note the two spaces after rw)     

Then enter the command passwd root and press Enter to modify the root password. The password must be entered twice and the password must be the same twice.   

Then enter the command  /sbin/reboot -f   and press Enter, restart the machine, and log in with the new password for testing

 

 

 

Guess you like

Origin blog.csdn.net/m0_69057918/article/details/131327691