- Boot the machine andd wait until the GRUB message appears and hit any key.
- Select current kernel version that you wish to boot and type a to append the line.
- Then type single or 1 at the end of the line (there should be a space between single and the last parameter). Then Enter to proceed.
[root@hostname /]# passwd
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@hostname /]#
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@hostname /]#
RHEL 6.0 has a bug that will prevent you from changing your root password in single user mode.You may temporarily disable SELinux. ()
# setenforce 0
2) Boot in to rescue mode
- Boot the machine using a CentOS/RHEL installation DVD or CD#1 and wait until the Welcome Screen appears.
- You can find three options,
- Install or upgrade an existing system
- Install system with basic video driver
- Rescue installed system
- Boot from local drive
- Select the Rescue installed system and Enter to proceed.
- Then it will ask you to Choose a Language and Keyboard Type. Choose appropriately.
- Then you will find a dialog whether you need network setup. you can choos yes or no it want mater.
- Then you will find Rescue dialog box. Choose Continue option and hit OK twice and Start shell. Then you will be in the shell.
Starting shell...
bash-4.1# chroot /mnt/sysimage
sh-4.1# passwd
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
sh-4.1# exit
exit
bash-4.1# reboot
bash-4.1# chroot /mnt/sysimage
sh-4.1# passwd
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
sh-4.1# exit
exit
bash-4.1# reboot
3) Using recovery mode
- Chose root Drop to root shell prompt.
- mount -o remount,rw / this will mount your root diectory with read/write permission.
- Type passwd
Thank you so much.
ReplyDeleteMy First Comment In this Blog...
ReplyDeleteI'd like this blog..