[root@localhost ~]# grub-md5-crypt
Password:
Retype password:
#输入两次密码
$1$Y84LB1$8tMY2PibScmuOCc8z8U35/
#生成加密的密码串
[root@localhost ~]# vi /boot/grub/grub.conf
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-279.el6.i686)
password --md5 $l$Y84LBl$8tHY2PibScmuOCc8z8D35/
#加入password选项,密码串是通过grub-md5-crypt命令生成的
root(hd0,0)
kernel /vmlinuz-2.6.32-279.el6•i686 ro root=UUID=b9a7ala8-767f-4a87-8a2b-a535edb362c9 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_N0_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_N0_LVM rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-279.el6.i686.img
[root@localhost ~]# vi /boot/grub/grub.conf
default=0
timeout=5
password --md5 $l$Y84LBl$8tMY2PibScmuOCc8z8U35/
#将password选项放在整体设置处
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-279.el6.i686)
root (hd0,0)
kernel /vmlinuz-2.6.32-279.el6.i686 ro root=UUID=b9a7ala8-767f-4a87-8a2b-a535edb362c9 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-279.el6.i686.img
default=0
timeout=5
password --md5 $l$Y84LBl$8tHY2PibScmuOCc8z8U35/
splashimage=(hdO,0)/grub/splash.xpm.gz hiddenmenu
title CentOS (2.6.32-279.el6.i686) lock
#在title字段下加入lock选项,代表锁死,如果不输入正确的GRUB密码,则不能启动root(hd0,0)
kernel /vmlinuz-2.6.32-279.el6.i686 ro root=UUID=b9a7ala8-767f-4a87-8a2b-a535edb362c9 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
initrd / initramf s-2.6.32-27.9 .el6.i686. img
新闻热点
疑难解答