redhat8重置root密码


1、查看系统

[root@rhel8pc1 test]# hostnamectl
   Static hostname: rhel8pc1
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 73f2da100acd48f8891e11d2a3d353ab
           Boot ID: 4951cc8ed88245478d3a317ef2c32257
    Virtualization: vmware
  Operating System: Red Hat Enterprise Linux 8.0 (Ootpa)
       CPE OS Name: cpe:/o:redhat:enterprise_linux:8.0:GA
            Kernel: Linux 4.18.0-80.el8.x86_64
      Architecture: x86-64

 

2、开机

 

 

 

3、开机, 按下e进入内核编辑页面

 

 

 

4、在此处增加rd.break

 

 

 

5、执行ctrl + x 进入救援模式, 然后执行:mount -o remount,rw /sysroot

 

 

 

6、执行 chroot /sysroot

 

 

 

7、执行passwd,并输入新密码(输入两次)

 

 

 

8、执行touch /.autorelabel

 

 

9、执行exit

 

 

10、执行reboot

 

11、输入刚才设置的密码登录即可

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM