Step 1 #> Single User Mode
- Restart the Server
- Press Enter in Redhat Enterprise Linux (2.6.32-71.el6_64)
- Press e edit
- Select the 2nd line which will start the word from kernel
- Press e to edit
- Type single or s or 1 in end of the line (after rhgb quiet words)
- Enter
- Press b to boot in single user mode
- Shell will come
- Type the passwd command and enter the new password for root account
Step 2 #> CD Rescue Mode
- Bash-4.1# This shell is read only so follow the step to read/write mode
- chroot /mnt/sysimage (This will change the shell to sh-4.1#)
- Type the passwd command and enter the new password for root account
OR
- Vim /etc/passwd and delete the x letter only (encypted passwd) in root user line.
Ex: root:x:
Step 3 #> Account Lock Remove
- Do the same as Single User Mode and run the below command for Unlocking the root user account
- Shell> passwd –u root
Step 4 #> Password Expiry Remove
- Go the Single User Mode
- Shell>chage –l root (To check the account status of root user)
- If Account expired run the below command
- Shell>chage –E never
RedHat Linux Grub Password
Recovery Steps:
- If you know the root password just remove the password line from /etc/grub.conf
- If you know the root password and want to change the grub password do the below steps
Shell>
grub-md5-crypt
#copy the encrypted
password and paste it in /etc/grub.conf as like below after the line
“timeout”
Password - -md5
encryptedpassword
Ex:
default 0
timeout 8
password --md5 $1$lS2dv/$JOcHkLosIn7CJk9xShzzJVw/
timeout 8
password --md5 $1$lS2dv/$JOcHkLosIn7CJk9xShzzJVw/
- If you don’t know the grub password and root password do the following steps
#Use the CD Rescue
Mode and check the grub.conf file
Shell>vim
/boot/grub/grub.conf
#Correct the
grub.conf file
I am using scientific linux 6.3, I wanted to rescue from cd but when I wrote chroot /mnt/sysimage; I got a message: command no recognize
ReplyDelete