3. System Repair mode
3.1 Single-user mode
(1) Select the 2nd item in the Grub interface and press "E" key to enter the editor . and add "1", i.e. "... quiet 1" after "... quiet" , where 1 represents single-user mode . You can then restart to enter single-user mode (note that no user name and password are required to enter at this time).
(2) Common bug fixes in single user mode
① Forgotten root password: #passwd Root // to set a password for the root user
② Modify the system default operating level :#vi/etc/inittab You can change the default run level
3.2 Disc Repair mode
(1) Insert the 1th CD ROM of CentOS into the CD of the virtual machine.
(2) Press "F2" to enter the BIOS, modify the drive from the CD.
(3) Then Select "Rescue installed System", select the appropriate language, keyboard layout,Shell interface and so on. You can enter Repair mode (prompt "bash-4.1#")
bash-4.1# chroot/mnt/sysimage Change the home directory to enter the operating system directory
sh-4.1# Cd/root
(4) The configuration file can be modified at this time, such as:
① Delete login password for grub interface : sh-4.1# vi/boot/grub/grub.conf then remove the password.
② Change the root password: #passwd Root
③ retrieve lost system files , such as retrieve/etc/inittab files:
SH-4.1# Rpm-qf/etc/inittab Query under/etc/which package does the Inittab file belong to?SH-4.1#mkdir/mnt/cdrom setting up a mount pointSH-4.1#Mount/dev/sr0/mnt/CDROM mounting DiscsSH-4.1# Rpm2cpio/mnt/cdrom/packages/initscripts-9.03. --1. el6.centos.i686.rpm| Cpio–idv./etc/inittab//Extract the Inittab file to the current directorySH-4.1#CPEtc/inittab/etc/inittab//Copy the Inittab file to the specified location
3.3 Linux the security
14th Linux Startup Management (3) _ System Repair mode