linux系统给grub设置密码
时间:2009-05-30 来源:sjhf
为了您的系统安全,请再为您的系统添加一道防护层。,及时有人接触您的物理区,没有密码,也进不了系统。
[root @ hero root]#vi /etc/grub.conf
设置grub.conf
在没设置密码以前:
# boot=/dev/sda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Enterprise Linux AS (2.4.2-15.EL)
root (hd0,0)
kernel /vmlinuz-2.4.21-15.EL or root=LABEL=/
initrd /initrd-2.4.21-15.EL.img
修改后的
# boot=/dev/sda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
password=abc
title Red Hat Enterprise Linux AS (2.4.2-15.EL)
lock
root (hd0,0)
kernel /vmlinuz-2.4.21-15.EL or root=LABEL=/
initrd /initrd-2.4.21-15.EL.img
注:这样GRUB密码设置为abc,lock的意思是进入linux时需要输入密码
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
给grub加密码 GRUB有两种加密方式,一种是lock,一种是利用非明文加密,也就是md5 128位加密。 明文lock方式
CODE:
#cat /boot/grub/grub.conf default 0 timeout=1 splashimage=(hd0,0)/boot/grub/splash.xpm.gz title Linux root (hd0,0) kernel /boot/vmlinuz-2.6.20 ro root=LABEL=/ initrd /boot/initrd-2.6.20.img . . . . . . title WindowsVista rootnoverify (hd0,8) chainloader +1
[Copy to clipboard]
上面是原grub.conf 注意: password密码是明文的,加有一个lock,别人进grub也可以改的 : ) 改成如下改grub.conf
CODE:
default 0 timeout=1 splashimage=(hd0,0)/boot/grub/splash.xpm.gz password=333 title linux lock root (hd0,0) kernel /boot/vmlinuz-2.6.20 ro root=LABEL=/ initrd /boot/initrd-2.6.20.img . . . . . . title WindowsVista rootnoverify (hd0,8) chainloader +1
[Copy to clipboard]
md5加密方式 运行 # /sbin/grub-md5-crypt (在grub中用: md5crypt) 输入你的密码,如333 生成一串东东, 是随即产生的,要记下来. 然后添加到 grub.conf 改grub.conf成如下
CODE:
default 0 timeout=1 splashimage=(hd0,0)/boot/grub/splash.xpm.gz password --md5 $akflKLUYG003hjue87tw320j(记下来的那串东东) title linux lock root (hd0,0) kernel /boot/vmlinuz-2.6.20 ro root=LABEL=/ initrd /boot/initrd-2.6.20.img . . . . . . title WindowsVista rootnoverify (hd0,8) chainloader +1
[Copy to clipboard]
ok |
相关阅读 更多 +