Difference between revisions of "Reset Password Debian"

From MS Computech
Jump to: navigation, search
(Created page with ''''Reset Password''' If you forgot your root password for your debian server use the following procedure to reset. Boot to the GRUB menu. Then, press <e> (for edit) before Linu…')
 
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
Boot to the GRUB menu. Then, press <e> (for edit) before Linux has a chance to boot.
 
Boot to the GRUB menu. Then, press <e> (for edit) before Linux has a chance to boot.
  
Using your keyboard arrow keys, move the cursor down a line or so, and press <e> (for edit) again, you should now be on the kernel line, and press <End> to go out to the very end of that line. Now hit the spacebar once, if necessary, to add a space, and then add one of the folllowing:
+
Using your keyboard arrow keys, move the cursor down a line or so, and press "e"
 +
(for edit) again, you should now be on the kernel line, and press <End> to go out to the very end of that line. Now hit the spacebar once, if necessary, to add a space, and then add one of the folllowing
 +
 
 
<pre>
 
<pre>
 
init=/bin/bash
 
init=/bin/bash
Line 13: Line 15:
 
init=/bin/sh
 
init=/bin/sh
 
</pre>
 
</pre>
Then press <Enter>, and you’re back at the kernel line, press <b> (for boot) and the computer will proceed to boot to a root prompt.
 
  
At this point, the root file system is still mounted read-only, so enter the following command:
+
Then press <Enter>, and you’re back at the kernel line, press "b"(for boot) and the computer will proceed to boot to a root prompt.
 +
 
 +
At this point, the root file system is still mounted read-only, so enter the following command
 +
 
 
<pre>
 
<pre>
 
mount -n -o remount,rw /
 
mount -n -o remount,rw /
 
</pre>
 
</pre>
 +
 
Then type:
 
Then type:
 +
 
<pre>
 
<pre>
 
passwd
 
passwd
 
</pre>
 
</pre>
 +
 
Enter your new password. Retype if asked to confirm.
 
Enter your new password. Retype if asked to confirm.
Then restart the machine by typing:
+
Then restart the machine by typing
 +
 
 
<pre>
 
<pre>
 
reboot
 
reboot
 
</pre>
 
</pre>
 +
 
Now you should be able to login with your new root password as required.
 
Now you should be able to login with your new root password as required.
  
  
 
[http://www.debianadmin.com/how-to-reset-debian-root-password.html Source]
 
[http://www.debianadmin.com/how-to-reset-debian-root-password.html Source]

Latest revision as of 23:17, 2 May 2011

Reset Password

If you forgot your root password for your debian server use the following procedure to reset.

Boot to the GRUB menu. Then, press <e> (for edit) before Linux has a chance to boot.

Using your keyboard arrow keys, move the cursor down a line or so, and press "e" (for edit) again, you should now be on the kernel line, and press <End> to go out to the very end of that line. Now hit the spacebar once, if necessary, to add a space, and then add one of the folllowing

init=/bin/bash

or

init=/bin/sh

Then press <Enter>, and you’re back at the kernel line, press "b"(for boot) and the computer will proceed to boot to a root prompt.

At this point, the root file system is still mounted read-only, so enter the following command

mount -n -o remount,rw /

Then type:

passwd

Enter your new password. Retype if asked to confirm. Then restart the machine by typing

reboot

Now you should be able to login with your new root password as required.


Source