Controlling the boot process - RHCSA
Why break the password?
When current password is lost, we use this mechanism to change root password and log in to the system. Simply we override the current password. If you have sudo privilege, log with another user and change the password. We have several ways to do this.- Use live cd - Mount the root file system and edit /etc/shadow file
- Interrupt the kernal
Interrupt the kernel to break the password Use the following steps.
- Reboot the computer
- While restarting press e to interrupt the kernal
- After that you need to find a line which was started with "linux". After moving the cursor to that line press END key to go to the end of the line. Then you can delete up to vcconsole.keymap=us. (do not delete it). There are two letters ro. you need to change it as rw. Simply read only to read write.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjV9NT9zRZPABtzL0fv2XK6O8IziEoPW6SVBCW5Beho8pTkMnVKbo797XxhHjHi9wq_B6-6PiwpKE9KXzDGuYazWaxLtk_oQGwItaSXrdM9RTro8IySTPNQIhsAlpxxxlW6QzI4JFXFqM4/s1600/4.png)
- Then add rd.break after deleting up to vcconsole.keymap=us. (add this end of the line). And press ctrl+x
- After that you will enter the emergency mode.
- Then you can see switch root:#/
- Enter following command to mount the roots' file system to kernel.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivdmZ9h3a3pJcLq3lguL0rwRwrk5WsTBuZcHLkQRhU2Tz28PdPx75idokwKg3Mn0sWWXBHTROopCw8gOIkZavJK8vtZMolI2vhmGBI2Ih1z-dUSREDZPAiv9LW2wdE4BMGLmrL8tdgBWI/s640/5.png)
- Then you switch to chroot jail.
- Then You need to enter the following command and enter the new password.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0_OYhR8Km4BX0p3iYDiJlcYbnwosGEobhCA2YKIh6_N7LNx2sqJcRJZs9666d7muNhdavHHvc6eRRhmC7Da2sB_qoNZxD5HOIpx0wepioRS_VlxWZFpACOqsRQNgSDy8adHr1BPGlWJg/s640/8.png)
- Following command is related to SELinux (labeling).
- Type exit and again exit .
Summary
- Reboot
- press e
- Find linux line and ro -> rw and delete upto vcconsole.keymap=us
- Add rd.break to end of that line
- mount -or /sysroot
- chroot /sysroot
- chage -l root
- passwd and enter the new password
- touch /.autorelabel
Author : Himesh Anjula
Comments
Post a Comment
Thank you for your comment