cancel
Showing results for 
Search instead for 
Did you mean: 
ronald992
Cadet
Cadet
  • 6,558 Views

Crack root password

Recently a week back I had attempted RHCSA certification and tried the below command but unfortunately was not successful in rhel 8 , does any one know otherway to crack root password.
Linux line end added rd.break - ctrl x - mount -o remount,rw /sysroot - chroot /sysroot -passwd root , changed the password and got message authentication successful and then touch /.autorelable and then exit and logout
11 Replies
Vincent2
Mission Specialist
Mission Specialist
  • 6,404 Views

I tried this also and it did not work... but this method worked for me.

#1. delete rhgb.silent with rd.break   also add   enforcing=0 (replaces the need for touch /.autorelable)

#2. mount -o remount,rw /sysroot (add read and write to the sysroot dir)

#3 chroot /sysroot

#4 whoami to check if you are root.

#5 passwd enter the new root password twice

#6 mount -o remount,ro / (add read only to the root dir)

#7 exit to get out of that directory

#8 reboot

#9 select the root user and login with the new password

Hope this helps :) Let me know if this is correct

 

ronald992
Cadet
Cadet
  • 6,391 Views

Thanks , sure let me try this and confirm
Cyrille_V
Mission Specialist
Mission Specialist
  • 6,350 Views

ronald992, don't forget to create an autoelabel file, BEFORE reboot (if selinux is enforcing on this box). Otherwise SELinux will refuse to recognize "touched" /etc/passwd and /etc/shadow files after your reboot and you will not be able to login at all and need to repeat this action again. Just do:

#> touch /.autorelabel     with dot)

and then reboot

SELinux will do re-labeling of the whole system after reboot and will accept your modified two files.

Regards

Vincent2
Mission Specialist
Mission Specialist
  • 6,323 Views

EmanuelHaine
Flight Engineer
Flight Engineer
  • 5,663 Views

Another way is to set "systemd.debug-shell" on kernel line at grub menu. Then CTRL+x

It will iniate a root session on tty9 and there is no need of remount, chroot and .autorelabel

IvanLabrovic
Flight Engineer
Flight Engineer
  • 5,213 Views

Hi! You may have a typo: .autorelable (yours )vs .autorelabel (this should be it)
Cyrille_V
Mission Specialist
Mission Specialist
  • 308 Views

Yes, you are correct, thank you.

RH-Yamato
Flight Engineer
Flight Engineer
  • 282 Views

This is one of the most frequently asked questions by Red Hat Certification beginners, and I always recommend everyone to refer to the official Red Hat documentation.

In the RHEL 9 documentation, click on "System Administration", then navigate to "Configuring basic system settings" as shown below:

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/#System%20Administration

スクリーンショット 2025-08-28 21.26.43.png

From there, go to section 7.6.3, titled "Resetting the root password".

I believe this is very useful content for anyone interested in our products.

スクリーンショット 2025-08-28 21.27.57.png

 

While many candidates try to memorize all the steps, that approach may work for some.

However, from my perspective, I strongly recommend becoming familiar with the official Red Hat documentation. It provides valuable information that can help you not only during the exam, but also in real-world situations.

Yamato Sakai
Learning & Development Senior Instructor
Red Hat Global Learning Service
Chetan_Tiwary_
Community Manager
Community Manager
  • 262 Views

@RH-Yamato very good point ! - to become familiar with the official Red Hat documentation - I second this statement.

Join the discussion
You must log in to join this conversation.