RHEL8 rd.break

发布时间 2023-10-16 17:00:32作者: Xielb

1、重启RHEL系统,引导界面按e键编辑

2、按下Ctrl+X  to start 使用启动配置

3、将文件系统重新挂载为可写

switch_root:/# mount -o remount,rw /sysroot

4、进入chroot环境(更改文件系统的root为/sysroot)

switch_root:/# chroot /sysroot

5、输入passwd命令,根据提示重置root密码

sh-4.4# passwd
Changing password for user root.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.

6、系统引导时重新标记所有文件

sh-4.4# touch /.autorelabel

7、重新将文件系统挂载为只读

sh-4.4# mount -o remount,ro /

8、使用exit推出chroot环境、重新引导进入系统