|
发表于 2003-10-12 21:28:26
|
显示全部楼层
方法二:经jerboa兄指教,我又读了一下grub文档,的确感觉到用md5加密校验Grub密码比较安全。为了也能让和我一样菜的弟兄,也能知道如何通过md5进行Grub密码加密,我不得不把这个教程写出来。哈哈,高手就是免读了,此文为菜鸟弟兄所准备。 
用md5加密校码Grub密码,这样会更安全。
1]对Grub的密码进行加密码运算,比如我们想设置grub的密码是123456,所以我们先要用md5进行对123456这个密码进行加密
[root@linux01 beinan]# /sbin/grub-md5-crypt
Password: 在这里输入123456
Retype password: 再输入一次123456
$1$7uDL20$eSB.XRPG2A2Fv8AeH34nZ0 这就是通过grub-md5-crypt进行加密码后产生的值。这个值我们要记下来,还是有点用。
[root@linux01 beinan]#
2]更改 /etc/grub.conf
比如我原来的/etc/grub.conf文件的内容是下面的。
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
所以我要在/etc/grub.conf中加入 password --md5 $1$7uDL20$eSB.XRPG2A2Fv8AeH34nZ0 这行,以及lock,应该加到哪呢,请看我的更改。
timeout=10
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
password --md5 $1$7uDL20$eSB.XRPG2A2Fv8AeH34nZ0
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
我们仔细看一下,从上面的我们改过的/etc/grub.conf中是不是已经用到了我们在第一步通过/grub-md5-crypt所产生的密码呢??是不是有点安全感了?? |
|