1、設置明文密碼
[root@ www.linuxidc.com ~]# grep -v '^#' /etc/grub.conf
default=0
timeout=5
password 123456 #GRUB啟動密碼
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-194.el5)
root (hd0,0)
password 123456 #啟動操作系統密碼
kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-194.el5.img
[root@ www.linuxidc.com ~]#
2、設置密文密碼
[root@ www.linuxidc.com ~]# grub-md5-crypt
Password:
Retype password:
$1$Qh6pX0$F4erzOSNARZoGvYtErIpx/
[root@ www.linuxidc.com ~]# grub-md5-crypt //使用md5生成加密密鑰
Password:
Retype password:
$1$Qh6pX0$F4erzOSNARZoGvYtErIpx/
[root@ www.linuxidc.com ~]# vi /etc/grub.conf
[root@ www.linuxidc.com ~]# grep -v '^#' /etc/grub.conf
default=0
timeout=5
password --md5 $1$Qh6pX0$F4erzOSNARZoGvYtErIpx/
#加上—md5的參數表示使用md5加密grub
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-194.el5)
root (hd0,0)
password 123456
kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.18-194.el5.img