关闭GRUB互动编辑

来自Ubuntu中文
跳到导航跳到搜索

关闭GRUB互动编辑

grub


grub> md5crypt

Password: ****** (ubuntu)

Encrypted: $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (encrypted password)

grub> quit


sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_backup

sudo gedit /boot/grub/menu.lst
  • 搜寻这一段文字
...


# If used in the first section of a menu file, disable all interactive editing

# control (menu entry editor and command-line) and entries protected by the

# command 'lock'

# 例如 password topsecret

# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/

# password topsecret

...
  • 在这下面新增下面这一行
password --md5 $1$ZWnke0$1fzDBVjUcT1Mpdd4u/T961 (这是编码过的密码)
  • 搜寻这一段文字
...

title Ubuntu, kernel 2.6.10-5-386 (recovery mode)

root (hd0,1)

kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro single

initrd /boot/initrd.img-2.6.10-5-386

savedefault

boot

...
  • 用下面这几行取代
#title Ubuntu, kernel 2.6.10-5-386 (recovery mode)

#root (hd0,1)

#kernel /boot/vmlinuz-2.6.10-5-386 root=/dev/hda2 ro single

#initrd /boot/initrd.img-2.6.10-5-386

#savedefault

#boot