linux 开机密码

版权声明:hanxinkong提供技术支持 https://blog.csdn.net/hanxinkong/article/details/83015975

1

.重启linux系统,出现GRUB启动菜单

2

按e健进入编辑状态

3

按向下的方向健,划到linux16所在行,把光标停在行末尾

4

在步骤3的行末尾,添加

rd.break console=tty0

5

按下Ctrl + x键进入恢复模式

6

以可写方式挂载硬盘中的根目录,并重设root密码

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

以可读写方式重新挂载根系统

switch_root:/# chroot /sysroot/

切换到根系统

sh-4.2# passwd root

设置秘密,设置时默认是不显示所填写的内容

sh-4.2# touch /.autorelable

标志下一次启动重做SELinux

sh-4.2# exit

退出根系统模式

switch_root:/# reboot

重新启动

猜你喜欢

转载自blog.csdn.net/hanxinkong/article/details/83015975