1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
开机在grub界面输入 e 在linux16开头的行的最后面输入 init=/bin/bash enforcing=0 按 ctrl键 + x 重新挂载根分区 mount -o rw,remount / 修改密码 重启 exec /sbin/init #运行级别被设置为重启 [root@web01 ~]# systemctl set-default reboot.target Removed symlink /etc/systemd/system/default.target. Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/reboot.target. [root@web01 ~]# systemctl get-default reboot.target 开机在grub界面输入 e 在linux16开头的行的最后面输入 rd.break 按 ctrl键 + x 重新挂载根分区 mount -o rw,remount /sysroot 赋予权限 chroot /sysroot 修改运行级别 exit reboot |
