• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Day 20/ 30 Days of Linux Mastery: Recover/Rescue Root Password in RHEL9

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
Table of Contents

  • Introduction
  • Step-by-Step Guide on Recovering the Root Password
  • Conclusion
  • Let's Connect


Introduction


Welcome back to day 20!. Today’s focus is on how to recover or rescue the forgotten root password in RHEL 9.

Yes, it happens that one might wake up one day and you can no longer remember your system root password. So, what do you do as the Linux System Administrator?

Let’s get into it!


Step-by-Step Guide on Recovering the Root Password

  • Start your virtual machine (I am using VirtualBox) or type reboot in your console.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



  • Once it is about to boot, quickly use the up and down arrow keys to select the option with 'rescue' in it.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.




  • Hit the letter 'e' on your keyboard quickly on the GRUB boot entry screen to enter edit mode. (This is for editing the parameters)


  • Look for the line starting with linux or linux16. Now, at the end of that line, add the following inside.

rd.break console=tty1 selinux=0
With this we do not need to do the 'touch /.autorelabel' that is creating the autorelabel file in the root directory anymore.

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



  • Click Ctrl+X to start (Press Enter for maintenance if prompted, to see the shell)


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



  • Now you on the shell, you need to remount and give it read/write mode. Type this prompt

mount -o remount,rw /sysroot - # press enter
chroot /sysroot - # The root we want to reset password for. Now press enter.

passwd - # Type this and press Enter, you will be prompted to enter the new password and retype it again to confirm it.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



  • Now type exit

  • Type exit again


  • The system will boot and request you to login. Now login as the root and the new password.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



That's it! We have successfully recovered our root password. No more panics!


Conclusion


Recovering root password is a must-know skill and very important for every Cloud, Linux or DevOps Engineer.

If this is helpful to you, feel free to bookmark, comment, like and follow me for Day 21!


Let's Connect!


If you want to connect or share your journey, feel free to reach out on

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

.
I am always happy to learn and build with others in the tech space.

#30DaysLinuxChallenge #Redhat#RHCSA #RHCE #CloudWhistler #Linux #Rhel #Ansible #Vim #CloudComputing #DevOps #LinuxAutomation #IaC #SysAdmin#CloudEngineer


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу