How To Change Root Password In Rescue Mode Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Boot into Rescue Mode:
The process for booting into Rescue Mode will vary depending on your system. Generally, you need to press a specific key during the boot process to enter the boot menu and select the Rescue Mode option.
2. Mount the System:
Once in Rescue Mode, you will need to mount the system in order to make changes. You can do this by running the following command:
# mount -o ro,remount /dev/sda1 /mnt
This will mount the system partition (sda1) as read-only (ro) on the /mnt directory.
3. Change the Root Password:
Once your system is mounted, you can change the root password with the following command:
# chroot /mnt
# passwd
You will be prompted to enter a new password for the root user. Once you complete this step, the password will be changed.
4. Unmount the System:
Finally, unmount the system by running the following command:
# umount /mnt
Your system will now be unmounted and you can reboot and log in with the new root password.