← Back to list

How to Set Up a GRUB Password

What is the GRUB password?

Chandan Kumar Kushwaha · 2026-03-07 03:31 · 1 claps · 0.5 min read
#linux #security #grub
Open on Medium ↗
Wiki topics: 🔓 · Open Source

How to Set Up a GRUB Password

What is the GRUB password?

GRUB passwords protect against unauthorized modification of boot entries or accessing the command line. In simple terms, on reboot, pressing ESC displays the Rescue Target menu. If we press ‘e’ for edit on a menu item, it should prompt for credentials.

Steps for setting up a GRUB password:

  1. ls /boot/grub2/ — There will be no user.cfg file
  2. grub2-setpassword (RHEL/CentOS) or grub-mkpasswd-pbkdf2 and adding it to /etc/grub.d/40_custom (Ubuntu/Debian) set GRUB password.
  3. ls /boot/grub2/ — There will be a user.cfg file, which will contain the credentials.
  4. To remove the GRUB password, delete the user.cfg file.

These methods typically prevent editing boot parameters, not necessarily booting the system itself, unless explicitly configured.

GRUB passwords are best used with BIOS/UEFI passwords for full protection.


메타데이터
post_id
80d4d3a7c0b3
slug
how-to-set-up-a-grub-password-80d4d3a7c0b3
url
https://medium.com/@chandankush132/how-to-set-up-a-grub-password-80d4d3a7c0b3
canonical_url
https://medium.com/@chandankush132/how-to-set-up-a-grub-password-80d4d3a7c0b3
author_url
https://medium.com/@chandankush132
status
ok
fetched_at
2026-06-17 08:20:12