歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux 下 grub 密碼的設置

Linux 下 grub 密碼的設置

日期:2017/2/28 17:16:56   编辑:Linux教程

一、GRUB 明口令加密;

比如我沒有設置密碼之前/etc/grub是如下的樣子:

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

加入口令以後就是下面這樣的:

default=1
timeout=10
splashimage=(hd0,7)/boot/grub/splash.xpm.gz
password=123456
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

從上面的可以看出,GRUB的密碼是123456,lock的意思就是把RedHat Fedora鎖住了。如果啟動時會提示錯誤。這時就應該按P鍵,然後輸入密碼就行了。我設置的是123456,當然應該輸入123456了,輸入別的密碼肯定不能通過,這樣是不是做到保密.

Copyright © Linux教程網 All Rights Reserved