BIOS and Boot Loader Security
Password protection for the BIOS (or BIOS equivalent) and the boot loader can prevent unauthorized users who have physical access to systems from booting using removable media or obtaining root privileges through single user mode. The security measures you should take to protect against such attacks depends both on the sensitivity of the information on the workstation and the location of the machine.
For example, if a machine is used in a trade show and contains no sensitive information, then it may not be critical to prevent such attacks. However, if an employee's laptop with private, unencrypted SSH keys for the corporate network is left unattended at that same trade show, it could lead to a major security breach with ramifications for the entire company.
If the workstation is located in a place where only authorized or trusted people have access, however, then securing the BIOS or the boot loader may not be necessary.
The two primary reasons for password protecting the BIOS of a computer are[14]:
Because the methods for setting a BIOS password vary between computer manufacturers, consult the computer's manual for specific instructions.
If you forget the BIOS password, it can either be reset with jumpers on the motherboard or by disconnecting the CMOS battery. For this reason, it is good practice to lock the computer case if possible. However, consult the manual for the computer or motherboard before attempting to disconnect the CMOS battery. Other architectures use different programs to perform low-level tasks roughly equivalent to those of the BIOS on x86 systems. For instance, Intel Itanium™ computers use the Extensible Firmware Interface (EFI) shell.
For instructions on password protecting BIOS-like programs on other architectures, refer to the manufacturer's instructions. The primary reasons for password protecting a Linux boot loader are as follows:
Community Enterprise Linux ships with the GRUB boot loader on the x86 platform. For a detailed look at GRUB, refer to the CentOS Installation Guide. You can configure GRUB to address the first two issues listed in "Boot Loader Passwords" by adding a password directive to its configuration file. To do this, first choose a strong password, open a shell, log in as root, and then type the following command:
When prompted, type the GRUB password and press Enter. This returns an MD5 hash of the password.
Next, edit the GRUB configuration file Replace The next time the system boots, the GRUB menu prevents access to the editor or command interface without first pressing p followed by the GRUB password.
Unfortunately, this solution does not prevent an attacker from booting into an insecure operating system in a dual-boot environment. For this, a different part of the Look for the For a DOS system, the stanza should begin similar to the following:
A To create a different password for a particular kernel or operating system, add a Each stanza protected with a unique password should begin with lines similar to the following example:
BIOS Passwords
Securing Non-x86 Platforms
Boot Loader Passwords
cat
command.
Password Protecting GRUB
grub-md5-crypt
/boot/grub/grub.conf
. Open the file and below the timeout
line in the main section of the document, add the following line:
password --md5
<password-hash>
<password-hash>
with the value returned by /sbin/grub-md5-crypt
[15].
/boot/grub/grub.conf
file must be edited.
title
line of the operating system that you want to secure, and add a line with the lock
directive immediately beneath it.
title DOS lock
password
line must be present in the main section of the /boot/grub/grub.conf
file for this method to work properly. Otherwise, an attacker can access the GRUB editor interface and remove the lock line.
lock
line to the stanza, followed by a password line.
title DOS lock password --md5
<password-hash>