We all mostly know a number of methods to bypass a Windows Administrator Password ( Hacking Windows Administrator Passwords ) + ( Videos Link ) , today we hack into a Linux machine root user password. We are aware that like Windows where Administrator is semi God, in Linux system, root is the God. So if yo have root password, you are in control of the linux system.

NOTE: We will cover this is multiple parts and methods. This is strictly for Educational purpose. Try on your own machines. Different Linux distro like CentOS, Fedora, Debian have very slightly difference, which will be mention. Also it is worth mentioning many server running CentOS version which can be said to be Red-Hat without technical support ( free version).

Requirements : A physical access to machine is required as this method does not works remotely, we will cover that in further posts.

So lets just hack Linux root Password !


Step 1: Edit the GRUB Menu

If you land into GRUB menu where you can select, good. Hold when you see GRUB menu ( Boot selection ), for both dual boot or single boot. If GRUB does not appears and it boots without a menu, Press Shift Key while booting until GRUB appears.
Press ‘e‘ to edit commands before booting, which is also mentioned at the bottom of screen, if any other key, choose accordingly.
NOTE: This change we will be doing won’t be permanent, the grub will only take the setting this time. Don’t confuse this with password reset part, that will be permanent.

We can see few options to select, it maybe a number of Operating Systems on dual/multi-boot machines.

Changes to be made in corresponding line starting with linux /boot for the OS you want to reset password, take care of this specially in multi-boot environments.

Step 2: Mount Disk in rw mode if the argument is available

The disk should be mounted in rw (which is by default in ro mode ) mode to write the changes. Anyways we can do this or skip this and mount the disk at later stage

Step 3: adding bash or sh

at the end of line starting with linux ( corresponding OS ) add init=/bin/bash
or init=/bin/sh and press Ctrl+X or F10 to boot with the temporary changes we made.

Step 4 : We got the root shell

Notice the # instead of usual $ ?
you can try to reset the password now by simply typing in passwd and enter button. This will prompt to enter new password, conform new password, and you are done with having root access on the machine.
But in case you had no option to mount disk as rw as in step 1, you get an error.
So mount the disk with mount -o remount, rw /

Step 5: Hack it ( Change root password )

in the shell ( after mounting in rw mode ), type passwd to set the new password for root. Confirm the new password. We have now set the root password.

Step 6 : Change password of other users

We now have root access, we can also change password for other users, just type in the shell passwd username , the password for the username ( if exists ) will be prompted to change just like previous step.

Step 7 : Reboot the Machine

You can now reboot the machine and start using it normally with the password you set above.


  1. To access GRUB menu, press ESC as soon machine starts
  2. change ro to rw init=/sysroot/bin/sh
  3. Now press Ctrl+X or F10 to boot.
  4. Access the machine by chroot /sysroot
  5. now change root password by running passwd
  6. Run touch /.autorelabel to force file system relabeling.
  7. Now you can exit, logout, reboot.


Same steps as described first for Ubuntu, works on most of the debian flavours, yes Ubuntu is a debian derivative.

CentOS 8

  1. Access GRUB menu just like others, ESC key at boot
  2. Go to line that starts with linux /boot and change ro to rw init=/sysroot/bin/sh
  3. CTRL+X or F10 to boot single user mode.
  4. Access the machine with command: chroot /sysroot.
  5. Run passwd to change the root password just like previous discussions.
  6. Execute touch /.autorelabel to force file system relabeling.
  7. Execute exit, logout,reboot

CentOS 7

  1. Access GRUB like previous steps.
  2. In line starting with “linux16”, change ro to rw init=/sysroot/bin/sh.
  3. CTRL+X or F10 to boot single user mode.
  4. Access the machine with the command: chroot /sysroot.
  5. Now passwd to change the root password.
  6. Reboot the system: reboot -f

CentOS 6

  1. Access GRUB and press A to append the command.
  2. add text single at the end of line and boot.
  3. passwd to reset your root password.

FreeBSD 12.x, FreeBSD 11.x, FreeBSD 10.x

FreeBSD boot menu has option for accessing Single user mode, press 2. Now when in root prompt type passwd to reset root password.

How to Hack root password in Linux part 2

Yes we will continue more in this tutorial , will post more on Linux password cracking in another post, where we will discuss more on how to get the exact same password so that we don’t have to change it.

Is this so Easy ? Why Password at All ?

In the upcoming article we will also discuss how to secure Linux machine, that is how to safeguard against such attacks/hacks.


Please enter your comment!
Please enter your name here