User Tools

Site Tools


linux:oel_redhat_reset_root_password

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux:oel_redhat_reset_root_password [2018/06/04 08:17]
admin
linux:oel_redhat_reset_root_password [2018/06/04 08:25] (current)
admin
Line 5: Line 5:
 FYI, I did this tutorial in Oracle Enterprise Linux (OEL) 7, but this is a distro based on Red Hat Enterprise Linux (RHEL), so these instructions should more-or-less work on any similar distro to OEL/RHEL, give or take a few versions. FYI, I did this tutorial in Oracle Enterprise Linux (OEL) 7, but this is a distro based on Red Hat Enterprise Linux (RHEL), so these instructions should more-or-less work on any similar distro to OEL/RHEL, give or take a few versions.
 Let’s get started: Let’s get started:
 +===== Reboot Linux =====
  
-  - Reboot Linux. When boot menu appears, press a key to stop it from booting any further. You should see something like this:{{ :​linux:​oel_reset_password_1.gif |}}\\  +Reboot Linux. When boot menu appears, press a key to stop it from booting any further. You should see something like this:{{ :​linux:​oel_reset_password_1.gif |}} 
-  ​- ​Press the “**e**” key on the top line of the menu, and then on the next screen that appears, scroll down to the line that starts with “**linux16**” and  change the end from “…**quiet LANG**…” to “…**quiet rw init=/​bin/​bash LANG**…” so it’ll look like this: {{ :​linux:​oel_reset_password_2.gif |}} \\ It’s fine if you don’t see the “**LANG**…” part after “…**quiet**” – just put the “**rw init=/​bin/​bash**” after “**quiet**” anyway. + 
-  ​- ​At the prompt that appears, type “**passwd**” to change the root password: {{ :​linux:​oel_reset_password_3.gif |}} +===== Press the “e” key and add line ===== 
-  ​- ​Now, depending on how your system is configured, you may also need to type “**touch /​.autorelabel**” to have it perform a SELinux relabel of the disk to allow root login. Try it first without this, and if it doesn’t work, then try it with this (since it can take a while if you have a large disk). + 
-  ​- ​Type “**/​usr/​sbin/​reboot –f**” to reboot. +Press the “**e**” key on the top line of the menu, and then on the next screen that appears, scroll down to the line that starts with “**linux16**” and  change the end from “…**quiet LANG**…” to “…**quiet rw init=/​bin/​bash LANG**…” so it’ll look like this: {{ :​linux:​oel_reset_password_2.gif |}} 
-  ​- ​After waiting a few minutes for the reboot to finish, you should be able to log in as root with your new password!+<​note>​It’s fine if you don’t see the “**LANG**…” part after “…**quiet**” – just put the “**rw init=/​bin/​bash**” after “**quiet**” anyway.</​note>​ 
 + 
 +===== Change password ===== 
 + 
 +At the prompt that appears, type “**passwd**” to change the root password: {{ :​linux:​oel_reset_password_3.gif |}} 
 + 
 +===== SElinux and autolabel option ===== 
 + 
 +Now, depending on how your system is configured, you may also need to type “**touch /​.autorelabel**” to have it perform a SELinux relabel of the disk to allow root login. Try it first without this, and if it doesn’t work, then try it with this (since it can take a while if you have a large disk). 
 + 
 +===== Reboot ===== 
 +Type “**/​usr/​sbin/​reboot –f**” to reboot. 
 + 
 +===== Done ===== 
 + 
 +After waiting a few minutes for the reboot to finish, you should be able to log in as root with your new password!
linux/oel_redhat_reset_root_password.1528093059.txt.gz · Last modified: 2018/06/04 08:17 by admin