Linux runlevels and retrieve root password

  1. runlevel diagram
    write picture description here

  2. The init command switches the run level and
    write picture description here
    write picture description here
    enters the following figure
    write picture description here
    to switch 3-5 successfully
    1), modify the root password. Single-user mode does not require a password to log in.
    The steps are as follows: After starting the virtual machine, press the enter key within 3s to enter the following interface; then press [e] to enter the startup file interface, and then
    write picture description here
    press [↓] to pull to the bottom; add “LANG=zh_cn.UTF-8” after the peer "init=/bin/sh"; then press [Ctrl+X] to enter "single user mode",
    write picture description here
    enter [ls], and press Enter; then enter [mount -o remount ,rw / ], press Enter (note the space, refer to the picture ); modify the password input, passwd root; after entering the password twice,
    write picture description here
    enter [touch /.autorelabel] and press Enter; then enter [exec /sbin/init] and press Enter; restart the system write picture description here
    and finally everyone can verify it again. I hope everyone has to help

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324778547&siteId=291194637