GRUB引导菜单设置密码,GRUB菜单我们可以用来进行系统修复,这种方式可以不用通过系统验证获得root权限,这无疑是一个极大的安全威胁,对此我们可以设置一个GRUB密码,只有输入正确才能对GRUB底层shell进行修改,方式如下:
grub-md5-crypt //输入两次安全密码进行md5加密
vim /boot/grub/grub.con
## grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to
this file
# NOTICE: You do not have a /boot
partition. This means that
#
all kernel and initrd paths are relative to /, eg.
#
root (hd0,0)
#
kernel /boot/vmlinuz-version ro root=/dev/xvda1
#
initrd /boot/initrd-[generic-]version.img
#boot=/dev/xvda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
password --md5 $1$DpQOE$2cO7.Sfc1EsgcQBUC7hRP.
title CentOS (2.6.32-431.23.3.el6.i686)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-431.23.3.el6.i686 ro
root=UUID=e76a7b8d-20c2-4f94-bdd1-f4054a34c206 rd_NO_LUKS rd_NO_LVM
LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16
crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us
rd_NO_DM rhgb quiet
initrd /boot/initramfs-2.6.32-431.23.3.el6.i686.img vim
/etc/security 可以修改系统启动时加载的配置文件 init q 重新读取系统配置文件