首页 运维 网络学院 查看内容

linux系统给grub设置密码

2009-6-25 10:42 726 0

摘要:       为了您的系统安全,请再为您的系统添加一道防护层。,及时有人接触您的物理区,没有密码,也进不了系统。 [root @ hero root]...
关键词: grub nbsp initrd boot 密码 root splashimage vmlinuz timeout 加密

      为了您的系统安全,请再为您的系统添加一道防护层。,及时有人接触您的物理区,没有密码,也进不了系统。 [root @ hero root]#vi /etc/grub.conf设置grub.conf 在没设置密码以前:# boot=/dev/sdadefault=0timeout=10splashimage=(hd0,0)/grub/splash.xpm.gztitle 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/sdadefault=0timeout=10splashimage=(hd0,0)/grub/splash.xpm.gzpassword=abctitle Red Hat Enterprise Linux AS (2.4.2-15.EL)lockroot (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.confdefault 0timeout=1splashimage=(hd0,0)/boot/grub/splash.xpm.gztitle Linux root (hd0,0)kernel /boot/vmlinuz-2.6.20 ro root=LABEL=/initrd /boot/initrd-2.6.20.img.... . . title WindowsVistarootnoverify (hd0,8)chainloader +1   上面是原grub.conf 注意: password密码是明文的,加有一个lock,别人进grub也可以改的 : )改成如下改grub.conf CODE: default 0timeout=1splashimage=(hd0,0)/boot/grub/splash.xpm.gzpassword=333title linux lockroot (hd0,0)kernel /boot/vmlinuz-2.6.20 ro root=LABEL=/initrd /boot/initrd-2.6.20.img.... . . title WindowsVistarootnoverify (hd0,8)chainloader +1   md5加密方式 运行# /sbin/grub-md5-crypt      (在grub中用: md5crypt)输入你的密码,如333生成一串东东, 是随即产生的,要记下来.然后添加到 grub.conf改grub.conf成如下 CODE: default 0timeout=1splashimage=(hd0,0)/boot/grub/splash.xpm.gzpassword --md5 $akflKLUYG003hjue87tw320j(记下来的那串东东) title linuxlockroot (hd0,0)kernel /boot/vmlinuz-2.6.20 ro root=LABEL=/initrd /boot/initrd-2.6.20.img.... . . title WindowsVistarootnoverify (hd0,8)chainloader +1   ok
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部