centos7破解root密码

方法一

  1. 重启服务器
  2. 按e进入编辑模式
  3. 将光标移到linux这一行,在末尾添加rd.break
  4. ctrl+x启动
  5. 进入命令行,mount -o remount,rw /sysroot
  6. chroot sysroot
  7. passwd root
  8. 修改root的密码
  9. touch /.autorelabel  #getenforce查看selinux有没有关,没关执行touch /.autorelabel selinux
  10. exit
  11. reboot(重启过程中要等一会)

方法二

  1. 按e进入编辑模式,光标移到linux一行
  2. 将ro包括ro在内这一行后面参数替换为rw init=/sysroot/bin/sh 
  3. ctrl+x启动
  4. chroot /sysroot
  5. passwd root
  6. touch /.autorelabel
  7. exit
  8. reboot
  • 4
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值