Home > OS >  For help! Virtual machine password forgot to do QAQ excuse me
For help! Virtual machine password forgot to do QAQ excuse me

Time:04-22

Md, didn't work for too long, the user name and password forgot all about

CodePudding user response:

Centos can operate, kali should almost
1, enter the grub boot interface, use the direction keys, select the recovery mode

2, and press "e" to enter edit mode
Line 3, find Linux * * * * * to the ro - & gt; Modified to rw, and good at init=/bin/sh added

4, Ctrl + x
5, look similar to prompt sh # 4.2
6, behind the prompt execute the command passwd change passwords

7, restart; If restarting error check whether selinux is closed

CodePudding user response:

1, start the grub menu, press e to edit interface would linux16 ro change to a rw init=/sysroot/bin/sh, and press CTRL + x start
# 2, chroot/sysroot switch to the system of real root directory
# 3, the passwd root to change the root user password
# 4, touch/. Autorelabel effect to selinux
# 5, the exit exit chroot
# 6, reboot again mark SElinux file system will take some time, so the restart slower
Don't consider SElinux, on the first floor has very perfect, but considering the influence of SElinux advice on a few more orders
  • Related