SLS

 
Title: HowTo: Reset lost root password
Description: Steps for resetting the root password for your system when you've forgotten it.

If you have forgotten root password don't worry, there is an easy way to reset it and create a new one

Step 1.


Disconnect computer from the network (you will work with root privileges)

Step 2.


Boot from your first install CD and press F1 at the first screen, then choose "Rescue System" from the menu and at the prompt type:
#root

  • NOTE: You do NOT need a password

Step 3.


Next at the prompt enter:
# cd /etc
# vi passwd

scroll down to the "root" line
In the passwd file look for root line (something like):
root:x:0:0:root:/root:/bin/bash

delete the "x" after "root:" leave the colons!

To delete letter under the cursor press ESC key and "x" -> so you are deleting letter "x" by pressing sequence ESC key "x"

After the modification above line shoul look like this:

root::0:0:root:/root:/bin/bash


Save file and exit:

Press ESC then wq and enter

Next edit:
# vi shadow


Press ESC then "x" (x will delete letter under cursor)
change root line from something like:
root:$2a$05$sin5i458ghsdfg8076t5ymp4y;jgslkdbvffd bshmRK:12856:0:10000::::

to
root::::

note four colons left!

Save the file:
ESC next wq

If something went wrong with editing press ESC and next q!

it is q with exclamation mark: "q!"

reboot your computer, log in as your normal user, and from the console window enter:
$ su
# passwd


And set the new root password. Log out as root:

You just set a new root password.

Addendum.

If you have lost user password: log in as a root and type
#passwd user_name

enter a new user password.

Sources:
broch (forum expert), http://www.aplawrence.com/Linux/lostlinuxpassword.html, http://www.geektimelinux.com/index.php?q=node/view/134

Credits:
broch

To add your own howto: http://forums.suselinuxsupport.de/index.php?showforum=50

Comments or Suggestions:
[forums.suselinuxsupport.de/index.php?showtopic=14201 http://forums.suselinuxsupport.de/index.php?showtopic=14201]]

There is one comment on this page. [Display comment]


Warning: include(http://forums.suselinuxsupport.de/ssi.php?a=active) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/customers/webs/slwiki/actions/footer.php on line 51

Warning: include() [function.include]: Failed opening 'http://forums.suselinuxsupport.de/ssi.php?a=active' for inclusion (include_path='.:/home/customers/webs') in /home/customers/webs/slwiki/actions/footer.php on line 51

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.0
Page was generated in 0.0321 seconds