Get the App
SLTechnology News&Howtos  ›  Servers  › 

CentOS 7 solution for forgetting root password

Shulou Source: shulou.com Published: 2022-06-03 10:27:42 09月21日 Update

CentOS 7 solution for forgetting root password

1. Restart and press esc

two。 Select the second menu and press e

3. Edit and modify two things: change ro to rw, and add init=/bin/sh after LANG=en_US.UFT-8

4. Press Ctrl+X to restart and change the password

5. Since selinux is open, you need to execute the following command to update the system information, otherwise the password will not take effect after reboot.

Touch /. Autorelabel

6. Restart the system

Exec / sbin/init

Tags: Password system method Information Command menu Update Select Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Microsoft MySQL Shulou Information Redmi