RSS



Quicktip - Forgot your grub password? Here’s how to change it.

Thu, Jan 4, 2007

ArsGeek, Linux, Quicktips, Ubuntu

Talk about it in our Forums

blech

Say you have a grub password to keep nefarious evil-doers from modifying your er… grubs. Then say a few months go by and you decide to modify some stuff but you’ve forgotten your password.

What do you do? Well, you can try this.

First, open up a Command Line Interface terminal (CLI) and type:

grub

Now you’re in grub. let’s create a new password.

md5crypt

You’ll be asked to enter a password. Do so now.

Then md5crypt will spit out a series of characters at you. That’s your encrypted password. It will probably look something like 3dRdd8i$82kJLKJ232K8/jKj3. You want to copy that line by highlighting it, right clicking and choosing copy.

Now quit grub by typing:

quit

Now we’re going to make a backup of your menu.lst file, the config file that tells grub what’s what.

sudo cp /boot/grub/menu.lst /boot/grup/menu.lst.bak

Let’s edit the menu.lst file now and add in the new encrypted password where the old encrypted password used to be.

gksudo gedit /boot/grup/menu.lst

Find the line that looks like this:

password –md5 (a bunch of crazy characters here)

That’s your old encrypted password. You’re going to paste your new encrypted password over it by highlighting the old one, right clicking and choosing paste.

Save your file and you can now use your new grub password to access grub.

Click the icon, share the link:
  • Digg
  • del.icio.us
  • MisterWong
  • Furl
  • Reddit
  • Technorati
  • BlinkList
  • feedmelinks
  • PopCurrent
  • Blogosphere News
  • Facebook
  • Fark
  • Mixx
  • Slashdot

This post was written by:

arsgeek - who has written 1980 posts on ArsGeek.


Contact the author

1 Comments For This Post

  1. DanO Says:

    I found this on the site below, found it to be much easier:

    on either the GRUB or LILO boot line, put: init=/bin/sh
    when you have a root prompt, do the following:
    mount -n -o remount,rw /
    passwd root
    (provide new password twice)
    mount -n -o remount,ro /
    sync;sync;sync
    hit the reset switch

    Forgotten Password - Good Guy Box Cracking
    by David A. Bandel [david@pananix.com]
    http://linux-sxs.org/administration/cracking.html

Leave a Reply