DbAppWeb.com

Menu
  • Home
  • Linux
  • HP-UX
  • macOS
  • Windows
  • Web Servers
  • App Servers
  • Storage

How to Protect GRUB with Password in Linux

May 13, 2016 DbAppWeb Admin
GRand Unified Bootloader (GRUB) is a default bootloader in Linux (all Unix-like) operating system. Anyone can log in into Single User Mode and may change the root user password, system settings etc. This is the big security flow. So, to prevent such an unauthorized person to access the system you may require having grub with password protection.
You can prevent the user from entering into Single User Mode and changing the setting of the system who may have physical access to the system.

Protect GRUB with a Password

  • Login as a root user, open the command prompt and type below grub-md5-crypt command. It will prompt for a GRUB password, type the password which you want to enter and repeat it, it will return the MD5 hash password. Copy the MD5 hash password and keep it for the next step.
    [root@server~]# grub-md5-crypt
    Password:
    Retype password:
    $1$EEp4n$WkdUnLYY9v.X1CjsPXZOV0
  • Open the /boot/grub/menu.lst or /boot/grub/grub.conf file in vi editor. It will be safe to take a backup of this file.
    [root@server~]# vi /boot/grub/grub.conf
    or
    [root@server~]# vi /boot/grub/menu.lst
  • Add the MD5 hash password in the file below hiddenmenu line and save the file.
    .
    .
    .
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    password --md5 $1$EEp4n$WkdUnLYY9v.X1CjsPXZOV0
     
    title Red Hat Enterprise Linux Server (2.6.18-308.el5)
    .
    .
    .
  • Reboot the system and try it pressing ‘p‘ to enter the password to unlock and enable the next features.

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Telegram (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
Prev Article
Next Article
Tags:Linux Sys Admin System Security

Leave a Reply Cancel Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Popular
  • Recent

Categories

  • Android (2)
  • Blogger (16)
  • Domain and Hosting (1)
  • Hardware Issues (7)
  • HP-UX (55)
  • HPE Data Protector (9)
  • IBM Lotus Notes (2)
  • IBM WebSphere Application Server (16)
  • Internet Tips & Tricks (15)
  • iOS (8)
  • JBoss/WildFly Application Server (2)
  • Linux (76)
  • macOS (15)
  • Microsoft Windows (31)
  • News and Updates (11)
  • Oracle Database (5)
  • SSL/TLS (1)
  • Storage Servers (23)
  • Tools/Softwares (1)
  • VMware ESXi (17)
  • Web Servers (14)
  • WordPress (5)

Archives

DbAppWeb.com

Solution of Database, Application and Web Server Problems

About DbAppWeb.com

One Stop Solution for Database Server, Application Server and Web Server Problems.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

DbAppWeb on Social Media

Copyright © 2025 DbAppWeb.com
Terms and Conditions   Theme by MyThemeShop.com