How to secure grub bootloader in linux 2017

Welcome Back Guys As i told you in previous tutorial that i will tell you that how to secure GRUB bootloader in linux So, Let’s Start with a Recap In First Tutorial, We learn that how to install Red Hat linux and in the end of the tutorial i forgot the login password So, we had to create a another tutorial, to break or reset the Root and User password in linux Now, In this tutorial we will learn that How to Secure GRUB Bootloader in linux We will patch that weakness which we used to reset or hack the root password in linux in previous tutorial by installing password in GRUB Bootloader Lets Start As usual Administrative tasks are carried out using terminal or console Open the Terminal or console As i told in last tutorial also If we want to make any changes in configuration we have to use super user access After getting root user access I wan to tell you that In Red hat there is a directory named /boot in /(root) Directory and in that /boot Directory there is another directory named grub and in grub directory there is a config file named grub.conf and this file grub.conf holds the configuration of the GRUB bootloader So, our task is to set a password in that file Before start to do anything we will use a safe approach. We will take backup of grub.conf file in which we are going to make changes. So that in case if in future we get any problem, then we can restore the previous backup file. Now we will go the directory and take backup of grub.conf /boot/grub/grub.conf I am copying grub.conf in /home/cybergears/Desktop as backup You can see the file has been copied and now we can edit or change the original grub.conf file You can use any editor to edit the grub.conf file For eg. vim editor, vi editor, or gedit or textedit but first we will have to create the password to install in boot loader and we will have to convert that password in hash to insure the security To make a hashed password we will use an inbuilt command grub-md5-crypt after typing command we will press enter to set the password now after complete process we will get the hash of our password Now we will copy the hash now we will past this password hash in grub.conf file Now , open the grub.conf file using any editor i am using gedit Now , grub.conf has been opened in gedit text editor The password has to be set just below the timeout=5 Now type the command password –md5 hash The hash we copied is a md5 hash The first 3 characters of the hash shows its type and $1$ specifies that its a md5 hash Now the password has been installed save the file and reboot the system now if you try to edit the boot options you will have to enter the password you just created Thanks for watching please like comment share and subscribe. We are open for suggestions please

Leave a Reply

Your email address will not be published. Required fields are marked *