Results 1 to 8 of 8

Thread: Recover Linux Root Password

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Recover Linux Root Password

    I'm running Red Hat 7.2 on a P4/256MB. I've got a GRUB loader, if that's of any help.

    How can I recover the root password, or at least change it? I've lost the current password, and can't log into Linux at all.

    Thank you.

  2. #2

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    dude ?

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    No non-root account!??!
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Put the disk into another computer, or access the root partition from elsewhere. In either /etc/passwd or /etc/shadow, replace the hashed password for root with a new hash of a password you *know*. That might need to be done on another linux system though (then again, you might just need to run it through md5).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by parksie
    Put the disk into another computer, or access the root partition from elsewhere. In either /etc/passwd or /etc/shadow, replace the hashed password for root with a new hash of a password you *know*. That might need to be done on another linux system though (then again, you might just need to run it through md5).
    I do have non-root accounts, but I do need the root account password.

    Parksie, how do I obtain the 'hash' of a password I want to put there?

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Ok, if you have non-root accounts, with passwords you know, replace the current root password hash with that of a known password
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    To make a hash, do this:
    Code:
    echo PASSWORDTOBEHASHED | md5sum
    ... In a *nix environment, of course.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  8. #8

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Thanks, much appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width