HOWTO:Lost Root Password

From PardusWiki
(Difference between revisions)
Jump to: navigation, search
(Undo revision 3138 by Itycajofa (Talk) Spam.)
 
Line 1: Line 1:
----
 
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
 
----
 
=[http://oleqatyqi.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
 
----
 
=[http://oleqatyqi.co.cc CLICK HERE]=
 
----
 
</div>
 
 
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 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).
  
Line 35: Line 27:
 
* When grub appears, press the Escape key. You may need to be quick! A window will pop up, saying,
 
* 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.
 
     You are leaving the graphical boot menu and starting the text mode interface.
* There are two buttons, &quot;OK&quot; and &quot;Cancel&quot;. Even though there is no mouse support, the OK-button is pre-selected, so just press Enter.
+
* 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.
 
* You will see your Grub menu entries in text mode. If necessary, using the up and down arrow keys highlight the Pardus entry.
* Press &quot;e&quot; — you will now see the grub entries that Grub uses for actually booting Pardus.
+
* 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 &quot;kernel&quot;.
+
* Using the arrow keys, select the line that begins with "kernel".
* Press &quot;e&quot; 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.
+
* 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:
 
* '''Add a space''', then append the following:
 
     single init=/bin/bash
 
     single init=/bin/bash
 
* Press Enter to save the changes. You will be returned to the previous screen.
 
* Press Enter to save the changes. You will be returned to the previous screen.
* Press &quot;b&quot; to boot Pardus. After a few seconds you will see
+
* Press "b" to boot Pardus. After a few seconds you will see
 
     (none) / #
 
     (none) / #
 
* Type the following:
 
* Type the following:
Line 52: Line 44:
 
* Type: reboot
 
* 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 &quot;passwd &lt;username&gt;&quot; and change the password for the user.
+
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.
  
  
Line 59: Line 51:
  
 
* You cannot get Grub into text mode (nothing happens or you are asked for a password)
 
* You cannot get Grub into text mode (nothing happens or you are asked for a password)
* When you press the &quot;e&quot; key in order to edit the Grub menu item for Pardus, 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 &quot;p&quot; 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.
+
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)
 
* When booted, open a terminal and become root (type: su)
* Type &quot;cfdisk /dev/sda&quot; (or &quot; /dev/sdb&quot;, or &quot; /dev/sdc&quot;, etc.)
+
* Type "cfdisk /dev/sda" (or " /dev/sdb", or " /dev/sdc", etc.)
* Look which name corresponds with the label &quot;PARDUS_ROOT&quot;. (Let's say for the sake of the argument it happens to be &quot;sda1&quot;)
+
* Look which name corresponds with the label "PARDUS_ROOT". (Let's say for the sake of the argument it happens to be "sda1")
* Press &quot;q&quot; to quit cfdisk.
+
* Press "q" to quit cfdisk.
 
* Type: mkdir /mnt/sda1
 
* Type: mkdir /mnt/sda1
 
* Type: mount /dev/sda1 /mnt/sda1
 
* Type: mount /dev/sda1 /mnt/sda1
 
* Type: nano -w /mnt/sda1/boot/grub/grub.conf
 
* Type: nano -w /mnt/sda1/boot/grub/grub.conf
* Look for and delete lines beginning with, &quot;lock&quot; and &quot;password&quot;.
+
* Look for and delete lines beginning with, "lock" and "password".
 
* Press CTRL+X to quit nano (and don't forget to save).
 
* Press CTRL+X to quit nano (and don't forget to save).
 
* Continue with the Second Method,
 
* Continue with the Second Method,

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.

    sudo su

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...

But if still have the dollar sign then head on over the...


Second Method

   You are leaving the graphical boot menu and starting the text mode interface.
   single init=/bin/bash
   (none) / #
   mount -o remount,rw /
   passwd: password changed successfully

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

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.

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox