How can I recover my Linux root password?

SHASHIMEDI2010 June 22, 2013
Pinterest Stumbleupon Whatsapp
Ads by Google

I am using Linux 6. I have forgotten the root password. I tried to recover it through the following steps:

1) Rebooted the system.
2) After this I have pressed e
3) Selected the kernel option and again pressed e
4) Later, at the end of the line, I gave one space and typed 1 and pressed enter key.
5) Now pressed b.

After completion of the above steps I received this error:

Telling INIT to single user mode.
init:rc main process (905)killed by TERM signal.
[root@bel/]#

……Please help me…..

  1. Chirag Shah
    June 28, 2013 at 6:29 pm

    If you are on # prompt then generate new encrypted password put it in one txt file then open /etc/shadow file and replace you new encrypted password in place of root's password. google it if you don't know which command you need to use to get encrypted password

  2. Bruce Epper
    June 23, 2013 at 5:54 am

    What you are doing is getting you most of the way there. It is ending with you sitting at a shell prompt logged in as the root user. Now all you need to do is issue the 'passwd' command to change the password for the root user to something you will remember.

    • Justin Pot
      June 24, 2013 at 1:37 pm

      Bruce nails it again; do that and you should be good. One question, though: what is Linux 6? Do you mean Linux Mint? Not important, just curious.

    • Bruce Epper
      June 24, 2013 at 10:27 pm

      I was curious about the Linux 6 aspect as well, but as it was irrelevant to the solution, I decided not to ask. Mint is up to 15 now, so I figured it wasn't that. Could be Debian even though it is up to 7.1. Other than those, I suppose it could be RH or CentOS.

    • SHASHIMEDI2010
      June 26, 2013 at 9:24 am

      I tried with the command PASSWD but it isn't prompting to set the new password..What could be the reason..

    • Bruce Epper
      June 26, 2013 at 11:46 am

      Is it displaying anything at all? BTW, passwd and PASSWD are not equivalent, so if you used all caps for the command, it should have given you the following: "PASSWD: command not found".

    • SHASHIMEDI2010
      June 27, 2013 at 7:58 am

      Yes sir i tried with passwd only,for that i am getting like this
      [root@bel/]#

    • Bruce Epper
      June 27, 2013 at 1:14 pm

      I have never seen a case where that didn't work, so I will need to try to replicate it here. What kernel are you using (use 'uname -r' to find out) and what Linux distribution and release/version?

    • ha14
      June 28, 2013 at 9:42 pm

      have you tried echo $PATH

  3. ha14
    June 22, 2013 at 7:25 pm

    try this
    http://unix.stackexchange.com/questions/35929/how-can-we-change-root-password
    5.Add the word ‘single’ at the end.

    How to Reset forgotten Root passwords
    http://linuxgazette.net/107/tomar.html

Ads by Google