Tuesday 14 August 2018

RESET ROOT PASSWORD ON RHEL 6/7 (ACCESS SINGLE USER MODE )


RHEL 6 

To access Single User Mode, you will need to boot your system to the "GRUB" boot-loader menu screen.

    1.As your system starts to boot, you will need to press the "Escape" key to access the GRUB menu screen:
    2.Now press "e" to edit.
    3.highlight the line starting "kernel" and press "e"again to edit the highlighted parameter.
       Once you press "e" you will be taken to the end of the line. Here you will need to press the "space"  
       key and then add the number "1" to the end of the line as per image below.
   
   4. Now press "Enter" to accept your entry. You will be taken back to the previous screen.
 
    5. Now press "b" to boot your system.Your system should now boot into "Single User Mode"
    6. At the command prompt you can issue the command "passwd" to change the root account password.
    7. Now reboot your system by issuing the "reboot" command.
RHEL 7

    1. Start your system and once you see your GRUB2 boot menu use "e" key to edit your default boot item. Usually it is the first line:
   
2.Once you hit "e" key you will see a screen similar to the given below:
 3.Move your cursor on "rhgb quit"keywords and replace them with  "init=/bin/bash"as show below:

4.Once you edit the boot line as show above press "CTRL+x" to start booting your RHEL 7                   system into a single mode.
5.Once you enter a single mode your root partition is mounted as Read Only "ro". In order to          mount our partition with Read/Write flag we use "mount" with a "remount" option as follows: 
             
 # mount -o remount,rw / 
        The above steps are shown below
6.Now use "passwd" command to change the root password. You will need to enter your password twice as shown below:
7. The additional step which needs to be taken on SELinux enables Linux system is to relabel SELinux context. If this step is ommited you will not be able to login with your new root password. The following command will ensure that the SELinux context for entire system is relabeled after reboot
 # touch /.autorelable
    
8.Reboot the system using given command.
                           
                           # exec /sbin/init

   After reboot you will be able to use your new root password.

1 comment:

  1. Procure microsoft office 2019 home & business, Step up with the new range of Microsoft Office, containing the 2019 versions of your favorite productivity software. Upgraded Word, Excel, PowerPoint and OneNote come with enhanced new time-saving features and a sleek, modern look.

    ReplyDelete

Create a New Virtual Machine

1.In the left pane, Click on the Hyper-V manager that you wish to host the new virtual machine. 2. In the right-hand Action pane, Click Ne...