Controlling the boot process - RHCSA

In this chapter we are going to teach about how to interrupt the kernel and break the current password.

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.
  1. Use live cd - Mount the root file system and edit /etc/shadow file
  2. 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. 

  • 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. 
  • Then you switch to chroot jail. 
  • Enter the following command.
  • This command is not that much need. But Use this for see whether user account is active or not.
  •  Then You need to enter the following command and enter the new password. 
  • Following command is related to SELinux (labeling).
  • Type exit and again exit .

Summary

  1. Reboot
  2. press e
  3. Find linux line and ro -> rw and delete upto vcconsole.keymap=us
  4. Add rd.break to end of that line 
  5. mount -or /sysroot
  6. chroot /sysroot
  7. chage -l root
  8. passwd and enter the new password
  9. touch /.autorelabel


Author : Himesh Anjula

Comments

Popular posts from this blog

Basic Configurations in Windows Server 2016 (2)

Interrupt the kernel to change the fstab - RHCSA