Breaking Root and Grub Password in Linux
Breaking Root and Grub Password in Linux
Let's look at recovering the root password from the boot loader. If you're using GRUB, then, as GRUB
loads up, highlight the Red Hat Linux entry on the GRUB menu and then press [E] to edit the boot
configuration. Locate the following line, something that looks like this:
Type the number '1' at the end. Doing so boots the PC into run level 1-single user mode, where
you're automatically logged in as root. This done, type 'passwd' at the prompt. You can enter a new
password here.
===================================================
METHOD 3
===================================================
Question.
we can crack the root password and GRUB password, if there is no Grum password, from the initial
screen (i.e. from the init 1); but with the GRUB password. While reading LinuxForYou, I saw your
section and thought you may be able to help.
Answer.
To break the GRUB start-up password, follow the steps given below:
1. Boot the system with the first Linux CD. At the boot prompt, type linux rescue to switch to rescue
mode. In rescue mode you will be asked if similar steps should be followed, which need to be
followed in the installation. Once you get the # prompt, type the following command:
# chmod /mnt/sysImage
2. Edit the grub.conf file and remove the passwd line from the file. Save the file and exit.
3. Once your machine reboots, you will be able to start your Linux OS in the usual manner.
=================================================
Let's look at recovering the root password from the boot loader. If you're using GRUB, then,
as GRUB loads up, highlight the Red Hat Linux entry on the GRUB menu and then press [E]
to edit the boot configuration. Locate the following line, something that looks like this:
Type the number '1' at the end. Doing so boots the PC into run level 1-single user mode,
where you're automatically logged in as root. This done, type 'passwd' at the prompt. You can
enter a new password here.
===================================================
METHOD 3
===================================================
Question.
I am doing a project on Linux platform. Someone has added the GRUB password to the
computer on which I am working and has also changed the root password. I can crack the
root password, if there is no Grub password, from the initial screen (i.e. from the init 1); but
with the GRUB password. While reading LinuxForYou, I saw your section and thought you
may be able to help.
Answer.
To break the GRUB start-up password, follow the steps given below:
1. Boot the system with the first Linux CD. At the boot prompt, type linux rescue to switch to
rescue mode. In rescue mode you will be asked if similar steps should be followed, which
need to be followed in the installation. Once you get the # prompt, type the following
command:
# chmod /mnt/sysImage
2. Edit the grub.conf file and remove the passwd line from the file. Save the file and exit.
3. Once your machine reboots, you will be able to start your Linux OS in the usual manner.
===================================================
bye
prosun
Let's look at recovering the root password from the boot loader. If you're using GRUB, then,
as GRUB loads up, highlight the Red Hat Linux entry on the GRUB menu and then press [E]
to edit the boot configuration. Locate the following line, something that looks like this:
Type the number '1' at the end. Doing so boots the PC into run level 1-single user mode,
where you're automatically logged in as root. This done, type 'passwd' at the prompt. You can
enter a new password here.
===================================================
METHOD 3
===================================================
Question.
I am doing a project on Linux platform. Someone has added the GRUB password to the
computer on which I am working and has also changed the root password. I can crack the
root password, if there is no Grum password, from the initial screen (i.e. from the init 1); but
with the GRUB password. While reading LinuxForYou, I saw your section and thought you
may be able to help.
Answer.
To break the GRUB start-up password, follow the steps given below:
1. Boot the system with the first Linux CD. At the boot prompt, type linux rescue to switch to
rescue mode. In rescue mode you will be asked if similar steps should be followed, which
need to be followed in the installation. Once you get the # prompt, type the following
command:
# chmod /mnt/sysImage
2. Edit the grub.conf file and remove the passwd line from the file. Save the file and exit.
3. Once your machine reboots, you will be able to start your Linux OS in the usual manner.
===================================================
Let’s look at some ways you can use to reset your Linux system’s password. You might
know that the root user can change the password for any other user. However what if you
forget your root password? This is what we would attempt to achieve here.
To reset your root password (or any other account’s password for that matter), there are
essentially two different situations which require varying approaches.
If you have GRUB installed and you have accesses to edit boot parameters of selected entries
then the job is as easy as it can get. Follow along and you shall have root access in no time.
Once you have root access you can pretty much do anything you want to do!
Highlight the GRUB entry for the Linux installation that you want to reset the password for.
Press ‘e’ to edit. Select the Kernel line. Add ‘single’ at the end of the kernel line. Press ‘b’ to
boot. If your system still requires you to enter the root password, add init=/bin/bash at the
end. Press ‘b’ to boot.
Either you would be taken to the root prompt directly or shown the recovery menu from
where you can choose the root prompt. Use passwd <username> to change the password
for any account.
Type reboot to reboot the system and then log in in with your new password.
Also, note that some distributions will create a recovery mode entry during install. If you
have the recovery mode entry listed in GRUB, you need not do any of the above, just choose
the recovery mode and then choose root prompt at the screen that follows.
If you are unable to use GRUB for whatever reasons (like password protected entries) you
can still reset the password using a Live CD (I will be using Ubuntu Live CD, you may use
any other). Just follow the steps below to achieve this:
When the system is ready, fire up a terminal window and get ready for some command line
action
Type sudo fdisk -l. In the output we are concerned to know which partition Linux is installed
on and what name the hard disk is using. (e.g) in this case it is /dev/sda1 is the required
partition. If you are sure about the partition you can skip this step.
Next we need to mount the Linux partition. Create a directory to act as mount point for the
partition. Use ‘sudo mkdir /media/linx_part‘
Mount the linux partition using the command ‘sudo mount /dev/sda1 /media/linx_part‘
Have you ever attempted such a password recovery? How did you go about it? Have some
other nice tricks to show off? Let us know in the comments.