Sunday, September 23, 2012

How To Disable Recovery Mode Under Ubuntu 12.10/12.04/Linux Mint 13

RecoveryMode is very useful for users who have boot issues because it will help them repair their systems using CLI mode with root privileges. The problem here is that unauthorized users who may have access into Recovery Mode would have root permissions on your system files without the need to enter the root password. If you are a bit concerned about this security issue, you can disable Recovery Mode using the instructions given below.

WARNING: Disable "Recovery Mode" at your own risk! Any incorrect modification may render your system unusable or unbootable.
The tutorial will help you disable Recovery Mode under Ubuntu 12.10/12.04/11.10, Linux Mint 13/12 or older. Here is how the Grub boot menu will look before and after modifications:

But firstly, let's backup the file we are going to edit with this command:

sudo cp /boot/grub/grub.cfg /boot/grub/grub.cfg.back

Edit now grub.cfg with this command:

sudo gedit /boot/grub/grub.cfg

For Linux Mint, edit it with this command:

sudo pluma /boot/grub/grub.cfg

In this file, press CTRL+F and search for "recovery" without quotes. The lines related to recovery mode should be commented all in order to disable RecoveryMode. They will be represented as follows:

menuentry 'Ubuntu, with Linux x.x.x- (...) (recovery mode)' (...) {

After being commented, they would look like this:

# menuentry 'Ubuntu, with Linux x.x.x- (...) (recovery mode)' (...) {
# (...)
# (...)
# (...)
# }

Here is a real example:

Click To Enlarge

After commenting all lines related to Recovery Mode, save your file and reboot your system. Hold down the SHIFT key to bring up the GRUB boot menu. If your modifications are correct, Recovery Mode line will not appear in the boot menu:

To enable Recovery Mode, run this command from the terminal:

sudo cp /boot/grub/grub.cfg.back /boot/grub/grub.cfg