forgotten root password

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prassaad
    New Member
    • Aug 2007
    • 16

    #1

    forgotten root password

    Hi friends,
    I hv forgotten my password & unable log in on my system....
    I hd tried by making system in SINGLE mode
    PLZ tell me different ideas to enhance my knowledge
  • WhiteRider
    New Member
    • Sep 2007
    • 37

    #2
    The best method I know of is setting the boot loader (mine is Grub) to boot differently. On my machine this is F2 to add in parameters. What you mention is "single" although I haven't tried this. What I done was "init=/bin/bash"

    Once you've added this it should boot up in a root terminal, here you can do the "passwd" command here. Simply set the new passwrod and reboot.

    Good luck!

    P.S please remember to create and USE another account other than root. This is very important as its easy to mess up your system under root and also if you get cracked the cracker will instantly have root privileges.

    Comment

    • noopurtiwari
      New Member
      • Aug 2007
      • 11

      #3
      Originally posted by prassaad
      Hi friends,
      I hv forgotten my password & unable log in on my system....
      I hd tried by making system in SINGLE mode
      PLZ tell me different ideas to enhance my knowledge
      The best way of doing it is the single mode (which you tried)
      Please tell me what problem you faced while doing the same. It is pretty easy and I guess if you give me the exact ouput i might help.

      Comment

      • prn
        Recognized Expert Contributor
        • Apr 2007
        • 254

        #4
        You don't say what kind of system you are dealing with, but whether it is Linux or Solaris or whatever, the answer is basically similar.

        The most effective way of dealing with a forgotten root password (and please do take White Rider's suggestion of not normally logging in as root) is to boot from a cd (live cd or installation cd) and then from a shell, you mount the HD / partition, navigate to /mnt/etc (or whereever you mounted it), back up your shadow file (just in case) with "cp shadow shadow.bak", then edit shadow, removing the characters between the first and second colons ( : ) so that the "root" line begins with

        root::

        DO NOT REMOVE ANYTHING ELSE!

        Sorry to shout, but that's very important. You could seriously mess up your system. (Of course, that's why I told you to make a backup first).

        Now you should be able to reboot, log in as root and set your password. Then don't forget it! After that, make sure to log in as a normal user most of the time and su to root only when you specifically need it.

        HTH,
        Paul

        Comment

        • vinot85
          New Member
          • Aug 2007
          • 53

          #5
          Hi buddy,

          You can just modify the kernel arguments by appending -s to the lines specified on the boot loader.This will give you the bash shell on single user mode.You can just use the passwd command to do the thing.

          The above idea will work out if there is no authentication by boot loaders.If there is any password specification for boot loaders, You cannot modify the kernel arguments.Still now i didnt heard any ideas to modify them.Is there any way to solve this problem?

          Comment

          Working...