Type : System
Operating System : Redhat,Fedora,Centos
In this article, i explain you how to protect your grub with a password.This action must be made to secure the access of your data and reduce the chance to reboot your server in INIT 1 or in recovery mode.
INSTALL
You must be root to do this action.
Generate your password in the good format (use a strong password):
#/sbin/grub-md5-crypt
Password:
Retype password:
$1$tfQcK/$8ClWUjUmCwHCcwtT3E6W.1
Now you have your password encrypted in MD5 hash format.
You have to edit grub configuration file /boot/grub/grub.conf and paste the line in blue with your hash password.
default=0timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-164.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup01/LogVol00
initrd /initrd-2.6.18-164.el5.img
password --md5 $1$tfQcK/$8ClWUjUmCwHCcwtT3E6W.1
Warning :
Unfortunately, this solution does not prevent an attacker from booting into an insecure operating system in a dual-boot environment.
















































