Labels

Sunday, 19 April 2015

Enter into a LINUX system whose password is unknown

Is there is someone who forgot his/her system password ?

Now need not to be panic, I have a solution (works on all distros and any version of LINUX Kernel). Just follow onscreen instruction:

  1. Power on your system and enter into "grub" boot menu.
  2. On grub menu enter "e" while highlighting the default boot menu.
  3. On that, you see a command similar to "auto rhgb quiet", replace it with "auto init=/bin/bash" and press enter. This will unable you to enter into bash terminal as a single user. Remember not to simply enter as single user, at that you are unable to make changes on passwd file.
  4. After that you will enter into previous menu, and then press "b" for booting.
  5. After a while you see terminal with last line as follows: "bash-4.1 #" or something similar to this.
  6. Enter following command one after other and press enter after termination each command:
    •  mount | grep root    "in order to check you enter into your single root partition
    •  mount -o remount, rw /     "in order to get read/write access"
    •  mount |grep root     "confirm file system is mounted"
  7. Enter command "passwd root" and then your new password and confirm that. In order to change password of root user.
  8. In final step enter "touch /.autorelabel" to SELinux context. If this step is omitted you will not able to enter with your new password and also cause system to cause problem.
  9. Reboot your system normally using "exec /sbin/init".

That's all, we just change our system root password.
We can now enter into our system using recently changed password.

No comments:

Post a Comment