Linux 下 grub 密码的设置


一、GRUB 明口令加密;

比如我没有设置密码之前/etc/grub是如下的样子:

default=1
timeout=10
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
title Fedora Core (2.4.22-1.2061.nptl)
root (hd0,7)
kernel /boot/vmlinuz-2.4.22-1.2061.nptl ro root=LABEL=/
initrd /boot/initrd-2.4.22-1.2061.nptl.img
title WindowsXP
rootnoverify (hd0,0)
chainloader +1

加入口令以后就是下面这样的:

default=1
timeout=10
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
password=123456
title Fedora Core (2.4.22-1.2061.nptl)
lock
root (hd0,7)
kernel /boot/vmlinuz-2.4.22-1.2061.nptl ro root=LABEL=/
initrd /boot/initrd-2.4.22-1.2061.nptl.img
title WindowsXP
rootnoverify (hd0,0)
chainloader +1

从上面的可以看出,GRUB的密码是123456,lock的意思就是把RedHat Fedora锁住了。如果启动时会提示错误。这时就应该按P键,然后输入密码就行了。我设置的是123456,当然应该输入123456了,输入别的密码肯定不能通过,这样是不是做到保密.

  • 1
  • 2
  • 下一页
【内容导航】
第1页:GRUB 明口令加密 第2页:GRUB 的md5加密方法

相关内容