Sunday, April 11, 2010

Protect GRUB from editing

At first I want to give you a brief intro about what GRUB is :-
GRUB (GRand Unified Bootloader) a default bootloader of LINUX.

It has two stages:-
1. The first stage is very small(446 bytes) and it resides within Master Boot Record or boot sector. It is called IPL (Initial Program Loader).
2. It Loaded from boot partition above 70MB.

Features of GRUB:-
1. Command line interface is available at boot prompt.
2. It supports ext2, ext3, fat, jfs file system.
3. It provides md5 password protection.

Now I am explaining you how you can protect grub from editing:-
a) Login at command prompt and give command grub-md5-crypt (to generate md5 password).
b) Now open grub configuration file i.e. /boot/grub/grub.conf and after the splash image add line
password --md5 md5password(copy the md5 password you get from console and paste it here.)
c) Reboot the system.
d) When the GRUB menu appears it will ask you to press p for password to unlock the menu (mainly to login as single user mode to change the root password.)

No comments:

Post a Comment