How to Reset Forgotten Root Password in RHEL/CentOS and Fedora

In this post will guide you simple steps to resetforgotten root passwordinRHEL,CentOSandFedoraLinux with example. There are various ways to reset root password which are.

  1. Booting intosingle usermode.
  2. Usingboot diskand editpasswdfile.
  3. Mountdriveto another system and changepasswdfile.

Here, in this article we are going to review “Booting into single user mode” option to reset forgottenrootpassword.

Cautious:We urge to take backup of your data and try it out at your own risk.

STEP 1. Boot Computer and Interrupt while booting atGRUBstage hitting ‘arrow‘ keys or “space bar“.

Booting Grub Stage

Booting GRUB Stage

STEP 2. Type ‘a‘ to modify kernel argument. Anytime you can cancel typing ‘ESC‘ key.

Modifying Kernel Parameters

Modify Kernel Argument

STEP 3. Append1at the end of “rhgb quiet” and press “Enter” key to boot into single user mode.

Append 1 at the GRUB

Append 1 at the Screen

STEP 4. Type command “runlevel” to know the the runlevel where you are standing. Here “1 S” state that your are in a single user mode.

Command runlevel

Type Command runlevel

STEP 5. Type ‘passwd‘ command without username and press ‘Enter‘ key in command prompt. It’ll ask to supply new root password and re-type the same password for confirmation. “Your are Done” Congratulation!!!

Passwd Command

Type passwd Command

What ifGRUB bootloader is password protected?We’ll cover in our next article, how to protectGRUBwith password and reset the same. Stay tuned…

If you find this article is helpful, or you may have some comments or query about it please feel free to contact with us through below comment box.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值