linux grub用grub-md5-crypt成生md5密码的方法
linux grub用grub-md5-crypt成生md5密码的方法
实验环境:Red Hat Enterprise Linux Server release 6.5 (Santiago)
[[email protected] ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[[email protected] ~]# grub-md5-crypt
Password: #这是输入:123456
Retype password: #再次输入:123456
$1$xdRKQ/$43ZXGkk1yziGE12Vlqgg71
#这是123456通过grub-md5-crypt进行加密后产生的值
[[email protected] ~]# vi /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
password --md5 $1$xdRKQ/$43ZXGkk1yziGE12Vlqgg71 #l添加123456通过grub-md5-crypt进行加密后产生的值,或者(passoword=123456)
#password=123456 #或者(passoword=123456)
hiddenmenu
title Oracle Linux Server Unbreakable Enterprise Kernel (3.8.13-16.2.1.el6uek.x86_64)
root (hd0,0)
kernel /vmlinuz-3.8.13-16.2.1.el6uek.x86_64 ro root=/dev/mapper/VolGroup-lv_root r
d_NO_LUKS rd_NO_MD rd_LVM_LV=VolGroup/lv_swap LANG=zh_CN.UTF-8 rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet crashkernel=128M initrd /initramfs-3.8.13-16.2.1.el6uek.x86_64.img
title Oracle Linux Server Red Hat Compatible Kernel (2.6.32-431.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_L
UKS rd_NO_MD rd_LVM_LV=VolGroup/lv_swap crashkernel=auto LANG=zh_CN.UTF-8 rd_LVM_LV=VolGroup/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet initrd /initramfs-2.6.32-431.el6.x86_64.img
这样就给grub 加密,再通单用户修改root 密码时,需要使用密码!多了一道门!
grub 加密后还可以通过安装光盘进行**。。。。