You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

OCI: How to Password Protect the GRUB2 Boot Menu

Applies to:

Oracle Cloud Infrastructure - Version N/A and later

Linux x86-64

Goal:

This document outlines the steps required to enable password protection on the grub2 boot menu. Once the password is set, it will require the password in order to boot into single user mode.

Solution:

Run the following command:

$ sudo grub2-setpassword
Enter password: 
Confirm password:

The “grub2-setpassword” creates the “user.cfg” file.

For BIOS installations:

 /boot/grub2/user.cfg

For UEFI installations:

/boot/efi/EFI/redhat/user.cfg

When attempting to boot to single user, the following prompt is displayed:

Enter username:

The “username” defaults to

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!