What are the operating levels of 1.Linux?
0: Turn off the machine
1: Single-user mode
2: Multi-user mode, Cannot use NFS service
3: Multi-user mode
4: Reserved
5: Graphical interface
6: Restart
Centos7 and CENTOS6 are not the same, you can use the following command to view:
[Email protected] ~]# ls-l/usr/lib/systemd/system/runlevel*target
lrwxrwxrwx. 1 root root 15 June 1 06:02/usr/lib/systemd/system/runlevel0.target-Poweroff.target
lrwxrwxrwx. 1 root root 13 June 1 06:02/usr/lib/systemd/system/runlevel1.target-Rescue.target
lrwxrwxrwx. 1 root root 17 June 1 06:02/usr/lib/systemd/system/runlevel2.target-Multi-user.target
lrwxrwxrwx. 1 root root 17 June 1 06:02/usr/lib/systemd/system/runlevel3.target-Multi-user.target
lrwxrwxrwx. 1 root root 17 June 1 06:02/usr/lib/systemd/system/runlevel4.target-Multi-user.target
lrwxrwxrwx. 1 root root 16 June 1 06:02/usr/lib/systemd/system/runlevel5.target-Graphical.target
lrwxrwxrwx. 1 root root 13 June 1 06:02/usr/lib/systemd/system/runlevel6.target-Reboot.target
If, how grub configures the password, cannot enter single-user mode, only through the way of the disc. Enter rescue mode.
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/97/9B/wKiom1kwMkLBqXBrAABXxdqL594536.jpg-wh_500x0-wm_ 3-wmp_4-s_1379007965.jpg "title=" snap10.jpg "alt=" Wkiom1kwmklbqxbraabxxdql594536.jpg-wh_50 "/>
After selecting the disc to enter the system, there are three options to select a third troubleshoorting.
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/97/9C/wKioL1kwMp2CVOPYAABs2OhKhr4400.jpg-wh_500x0-wm_ 3-wmp_4-s_1588798397.jpg "title=" snap11.jpg "alt=" Wkiol1kwmp2cvopyaabs2ohkhr4400.jpg-wh_50 "/>
Select the red arrow that, rescue mode recovery system, then enter, then enter
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/97/9C/wKioL1kwMufgnH-wAABDqsWDvgc797.jpg-wh_500x0-wm_ 3-wmp_4-s_2211877153.jpg "title=" snap12.jpg "alt=" Wkiol1kwmufgnh-waabdqswdvgc797.jpg-wh_50 "/>
After the carriage return, the interface appears:
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/97/9C/wKioL1kwMyLxacD1AAEC8x2_ctE375.jpg-wh_500x0-wm_ 3-wmp_4-s_2508067902.jpg "title=" snap13.jpg "alt=" Wkiol1kwmylxacd1aaec8x2_cte375.jpg-wh_50 "/>
Select 1, continue continue, and then enter
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/97/9B/wKiom1kwM2ijUEjAAAEcDlRyBQU346.jpg-wh_500x0-wm_ 3-wmp_4-s_10959091.jpg "title=" snap14.jpg "alt=" Wkiom1kwm2ijuejaaaecdlrybqu346.jpg-wh_50 "/>
This time you find ls/mnt/sysimage/root/and normal ls/root content.
Description/mnt/sysimage equivalent to the normal system/root directory
Using commands
chroot/mnt/sysimage/
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/97/9C/wKioL1kwNA_w8CAZAAECPTeO0qY652.jpg-wh_500x0-wm_ 3-wmp_4-s_2084344968.jpg "title=" snap15.jpg "alt=" Wkiol1kwna_w8cazaaecpteo0qy652.jpg-wh_50 "/>
To modify a password using the passwd command
passwd Root
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/97/9B/wKiom1kwND-SR0IeAAEfukx38YA993.jpg-wh_500x0-wm_ 3-wmp_4-s_1219695039.jpg "title=" snap16.jpg "alt=" Wkiom1kwnd-sr0ieaaefukx38ya993.jpg-wh_50 "/>
Restart the server to complete the password modification
linux-Rescue Mode