Root Password Reset: Difference between revisions
Jump to navigation
Jump to search
m (→References) |
(Changed title, added method to change any password) |
||
Line 1: | Line 1: | ||
== Debian | == Resetting the root account password on Debian (or any account password) == | ||
This has been tested and is known to work with Debian versions 6, 7, and 8. It can also be used to change any account password. | |||
=== Method 1 === | === Method 1 === | ||
* Boot into '''grub''', select '''''single user''''' but '''do not press enter'''. | * Boot into '''grub''', select '''''single user''''' but '''do not press enter'''. | ||
Line 11: | Line 13: | ||
mount -rw -o remount / | mount -rw -o remount / | ||
# Change password with | # Change the root account password with | ||
passwd | passwd | ||
# Change any other account password with | |||
passwd username | |||
# type new password, confirm and hit enter and then reboot. | # type new password, confirm and hit enter and then reboot. | ||
Line 25: | Line 30: | ||
root::$6$fsdsdgdsg74.:14862:0:99999:7::: | root::$6$fsdsdgdsg74.:14862:0:99999:7::: | ||
* Reboot as '''root''' without a password. | * Reboot as '''root''' without a password. | ||
* At the end use '''passwd''' to set a new root password. | * At the end use '''passwd''' to set a new root password (or '''passwd username''' to change any account password). | ||
* Reboot and login as '''root''' with the new root password. | * Reboot and login as '''root''' with the new root password. | ||
Line 31: | Line 36: | ||
* [http://derwynd.com/2011/04/14/debian-squeeze-change-root-password/ Debian Squeeze change root password] | * [http://derwynd.com/2011/04/14/debian-squeeze-change-root-password/ Debian Squeeze change root password] | ||
* [http://c-nergy.be/blog/?p=1777 Griffon's IT Library] - [[Media:Debian-PVE-root-Password-Reset_pdf.zip|Cache]] | * [http://c-nergy.be/blog/?p=1777 Griffon's IT Library] - [[Media:Debian-PVE-root-Password-Reset_pdf.zip|Cache]] | ||
* https://wiki.debian.org/Root | |||
[[Category: HOWTO]] | [[Category: HOWTO]] |
Revision as of 10:35, 31 May 2016
Resetting the root account password on Debian (or any account password)
This has been tested and is known to work with Debian versions 6, 7, and 8. It can also be used to change any account password.
Method 1
- Boot into grub, select single user but do not press enter.
- Press e to go into edit mode.
- Scroll down to the kernel line, it starts with "linux /boot/vmlinuz-2.6……."
- Scroll to the end of that line and press space key once and type init=/bin/bash
- Press Ctrl X to boot
# Remount / as Read/Write
mount -rw -o remount /
# Change the root account password with
passwd
# Change any other account password with
passwd username
# type new password, confirm and hit enter and then reboot.
Method 2
- Boot from another installation of Debian. (One can use a LiveCD to get access to the "/" partition.)
- Then, mount the partition where you have Squeeze's "/", then changed directory to /mnt/etc
- Used vim / nano as an editor to edit the file shadow.
- Find the line starting with root:
- Delete everything between the first and second colons (:), and the line will now look like:
root::$6$fsdsdgdsg74.:14862:0:99999:7:::
- Reboot as root without a password.
- At the end use passwd to set a new root password (or passwd username to change any account password).
- Reboot and login as root with the new root password.