Forgotten root password: Difference between revisions

From DISI
Jump to navigation Jump to search
(Steps on how to break into a physical machine after root is inaccessible)
 
Line 2: Line 2:


===Steps to Reset root Password===
===Steps to Reset root Password===
1) Restart the computer
1) Restart the computer <br />
2) During kernel selection at boot, press 'e' to edit the kernel line
2) During kernel selection at boot, press 'e' to edit the kernel line <br />
3) At the end of the kernel line, type  
3) At the end of the kernel line, type  
  init=/bin/bash
  init=/bin/bash
4) Save that to the kernel line and then press 'b' to boot
4) Save that to the kernel line and then press 'b' to boot <br />
5) Enter 'su' to become root.
5) Enter 'su' to become root. <br />
6) Type command:
6) Type command:
  mount -o remount,rw /
  mount -o remount,rw /
7) Change root password with command passwd.
7) Change root password with command passwd. <br />
8) After password successfully changed, remount filesystem as read-only:  
8) After password successfully changed, remount filesystem as read-only:  
  mount -o remount,ro /  
  mount -o remount,ro /  
9) Press ctrl + alt + del to restart computer.  Boot normally and root password should be reset
9) Press ctrl + alt + del to restart computer.  Boot normally and root password should be reset

Revision as of 17:59, 1 June 2017

Sometimes we accidentally put in the wrong root password when creating a host or we accidentally change it to something we didn't mean to. That's no problem as long as you have physical access to the machine.

Steps to Reset root Password

1) Restart the computer
2) During kernel selection at boot, press 'e' to edit the kernel line
3) At the end of the kernel line, type

init=/bin/bash

4) Save that to the kernel line and then press 'b' to boot
5) Enter 'su' to become root.
6) Type command:

mount -o remount,rw /

7) Change root password with command passwd.
8) After password successfully changed, remount filesystem as read-only:

mount -o remount,ro / 

9) Press ctrl + alt + del to restart computer. Boot normally and root password should be reset