HOWTO:Lost Root Password
(New page: While we all know we should always choose a root password that is too difficult to guess, yet easy enough to remember, occasionally you may find yourself sitting at a box and you don't hav...) |
|
| (One intermediate revision by one user not shown) | |
Latest revision as of 14:08, 30 November 2010
While we all know we should always choose a root password that is too difficult to guess, yet easy enough to remember, occasionally you may find yourself sitting at a box and you don't have the root password (anymore).
While it is not possible to *retrieve* the password for root, luckily it is possible to *change* it without knowing the current password.
First method
If you can log on as a user who has administrative rights (as asked and recommended during Pardus install), then it is quite easy to change the root-password.
- Open Konsole and type
sudo su
- Type your own password and press Enter.
Either the cursor is next to a pound sign (#), or you get a message that you are not in the sudoers list and the cursor is next to a dollar sign ($)
If you see the pound sign, then...
- Type: passwd
- Enter and confirm a new password.
- All done.
But if still have the dollar sign then head on over the...
Second Method
- Start or restart the computer.
- When grub appears, press the Escape key. You may need to be quick! A window will pop up, saying,
You are leaving the graphical boot menu and starting the text mode interface.
- There are two buttons, "OK" and "Cancel". Even though there is no mouse support, the OK-button is pre-selected, so just press Enter.
- You will see your Grub menu entries in text mode. If necessary, using the up and down arrow keys highlight the Pardus entry.
- Press "e" — you will now see the grub entries that Grub uses for actually booting Pardus.
- Using the arrow keys, select the line that begins with "kernel".
- Press "e" again — by default the cursor will be at the very end of this line. If not, use the arrow keys to navigate to the end of the line.
- Add a space, then append the following:
single init=/bin/bash
- Press Enter to save the changes. You will be returned to the previous screen.
- Press "b" to boot Pardus. After a few seconds you will see
(none) / #
- Type the following:
mount -o remount,rw /
- Type: passwd
- Enter the new password when asked. The computer should respond with,
passwd: password changed successfully
- Type: reboot
When the logon screen appears, log on as a regular user, or, if you don't know that password either, press CTRL+ALT+F1 and log on as root. Then type "passwd <username>" and change the password for the user.
Compliations
- You cannot get Grub into text mode (nothing happens or you are asked for a password)
- When you press the "e" key in order to edit the Grub menu item for Pardus, nothing happens or you are asked for a password.
In either case press "p" and see if you are then asked for a password. If so, then Grub is password protected and you will need a live-cd to boot from.
- When booted, open a terminal and become root (type: su)
- Type "cfdisk /dev/sda" (or " /dev/sdb", or " /dev/sdc", etc.)
- Look which name corresponds with the label "PARDUS_ROOT". (Let's say for the sake of the argument it happens to be "sda1")
- Press "q" to quit cfdisk.
- Type: mkdir /mnt/sda1
- Type: mount /dev/sda1 /mnt/sda1
- Type: nano -w /mnt/sda1/boot/grub/grub.conf
- Look for and delete lines beginning with, "lock" and "password".
- Press CTRL+X to quit nano (and don't forget to save).
- Continue with the Second Method,