centos7忘记root密码

浏览次数:2399 关键词 ( 密码  root  )

  1. ux系统
  2. 进入grub2界面,按e按键
  3. linux16开头行中的最后如下代码rd.break
  4. ctrl+x来进行启动
  5. rw的模式来挂载/sysroot文件系统 
    mount -oremount,rw /sysboot
  6. /sysroot作为root的文件系统 
    chroot /sysroot
  7. 修改root密码 
    passwd
  8. 确保在下次启动过程中进行relable动作 
    touch /.autorelabel
  9. 执行两次exit来退出所有的命令行模式,继续启动操作系统