7:19 AM
If you are new in Linux, especially for you who still use dual-boot with Microsoft Windows or other operating systems, I will share my knowledge on how to change default boot for GRUB. There are a lot of GUI applications to do such thing but knowing the basic concept is important if you want to know more about Linux. Before we get started, please take a closer look at the picture below:
OK! Let's make an assumption, we have five entries in GRUB numbered with 0 until 4 which number "0" (Ubuntu) is default boot for GRUB. It means that if you don't do anything when this screen appears, the "0" entry will be selected to boot. Now, we want to make the "4" (Windows XP) entry to be a default boot for GRUB. To do such thing, we have to edit "/boot/grub/grub.cfg" file, simply type the following command:
- sudo gedit /boot/grub/grub.cfg
New Gedit window will be opened and shows the content of "/boot/grub/grub.cfg". Search for statement
set default="0"!
Do you find it? All you need to do is changing the "0" number to "4". It makes the "4" entry (Windows XP) set to default boot for GRUB. Don't forget to save your work and reboot to see the changes.
Regards :)
» read more....
5:24 AM
Ubuntu comes with GRUB recovery mode that enables you to recover or rescue your broken system. Unfortunately, everyone can drop a root shell without having to enter the password. Of course, that makes your system less secure. Please imagine that a stranger can access GRUB recovery mode and make some changes to your system! Today, I'd like to show you how to protect GRUB entries with password especially GRUB recovery mode. So, if someone want to access recovery mode, he must enter the password first.
Let's get started. Ope the terminal and type "grub" so that the GRUB shell appears. Enter the following command:
You will be asked for a password, please enter your desired password and hit Enter. You'll get an encrypted password, please remember or paste it on somewhere you like.
Open "/boot/grub/menu.lst" with your favorite text editor (root privilege needed). To protect GRUB entries you must add the following line to each entries you want to protect:
- password --md5 encrypted_password
E.g.:
Before editing:
title Ubuntu, kernel 2.6.8.1-2-386 (recovery mode)
root (hd1,2)
kernel /boot/vmlinuz-2.6.8.1-2-386 root=/dev/hdb3 ro single
initrd /boot/initrd.img-2.6.8.1-2-386
After editing:
title Ubuntu, kernel 2.6.8.1-2-386 (recovery mode)
root (hd1,2)
kernel /boot/vmlinuz-2.6.8.1-2-386 root=/dev/hdb3 ro single
initrd /boot/initrd.img-2.6.8.1-2-386
password --md5 $1$w7Epf0$vX6rxpozznLAVxZGkcFcs
You might like to run the following command the restrict "/boot/grub/menu.lst" for being read by regular user:
- sudo chmod 600 /boot/grub/menu.lst
Enjoy :)
» read more....