Root password


Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Root password

  1. #1
    Join Date
    Jan 2005
    Posts
    229

    Root password

    I have forgotten my root password in Linux. I alos just rrealized that my boot floppy does not work.
    Is there any way I can recover the root password?
    I can still login as a normal user.
    The Problem is Choice.

  2. #2
    Join Date
    Feb 2004
    Location
    Singapore
    Posts
    2,171
    can you boot from cd? if you can, then just use a normal live-cd and chroot into the system. (just search for chroot info, and gentoo installation guide includes that part) then change passwd with passwd root

    if you can't, then go get tom's rtbt. its floppy linux or any other linux floppy.

    however, you cannot retreive the password, just change it
    Come under the reign of the Idiot King...
    Come to me ... I love linux!

    Registered Linux user: Idiot King #350544

  3. #3
    Join Date
    Mar 2003
    Location
    Tampa, FL USA
    Posts
    2,193
    1) Boot from LiveCD
    2) Become root
    3) "chroot" to your harddrive
    4) run "passwd" to create a new password
    5) exit & reboot

  4. #4
    Join Date
    Oct 2002
    Location
    Rochester Institue of Technology
    Posts
    308
    Rather than chroot-ing, which can sometimes be messy, I would reccomend the following:

    1) Boot a live cd
    2) use a text editor to open up /etc/shadow
    3) delete the hash of the root password from the appropiate line, eg
    Code:
    jcheney root # cat /etc/shadow | grep root
    root:$1$knF/onA/$WWFstCLKwYe9dd6gbujUn:12741:0:::::
    jcheney root #
    would become
    Code:
    jcheney root # cat /etc/shadow | grep root
    root::12741:0:::::
    jcheney root #
    4) reboot into system, and change the password, because right now it is blank!

    This has worked for me on a couple of different occations.
    http://counter.li.org
    #277081
    http://www.joshcheney.com

  5. #5
    Join Date
    Mar 2003
    Location
    Tampa, FL USA
    Posts
    2,193
    Depending on how PAM is setup, erasing the password may or may not work.

    But either way, good suggestion drummerboy195. I hadn't thought of that.

  6. #6
    Join Date
    Jan 2005
    Posts
    229
    I do not have access to the CD's now.
    The Problem is Choice.

  7. #7
    Join Date
    Sep 2002
    Location
    Harlow, UK
    Posts
    1,788
    You can create a rescue floppy. You will be able to do the same with it.

    http://www.toms.net/rb/

    [EDIT]
    1000 useless posts
    Last edited by deathadder; 02-01-2005 at 10:07 AM.
    If you have to ask why you want to install Linux, then perhaps you shouldn't.
    -- Michael D. Watts (Gone but never forgotten)

    Linux is not Windows | Posting Guidelines

    Code Monkey (YouTube)

  8. #8
    Join Date
    Jan 2003
    Location
    Zurich, Switzerland
    Posts
    2,658
    Originally posted by Architect
    I do not have access to the CD's now.
    Umm, is this connected to your old problem or is it a new one? If it's a new one:

    • Check if the CD is correctly mounted.
    • Check in /etc/fstab if the proper device in /dev is configured to mount at your mounting point.
    • Check in the same file if you have the priviledges to mount a CD-ROM.
    • Check if the filesystem on your CD-ROM is supported by your kernel.


    Well, just a few ideas on where to check. To get more exact help you need to provide further details about your problem.

    "What can be said at all can be said clearly, and what we cannot talk about we must pass over in silence."

    Tractatus Logico-Philosophicus by Ludwig Wittgenstein (1889-1951)

  9. #9
    Join Date
    Jan 2003
    Posts
    979
    no need for a CD/floppy. unless you disabled it, there is a mode called "single user mode". if you use grub, just add "single" in the end of the boot line in the boot screen.

  10. #10
    Join Date
    May 2003
    Location
    Philadelphia
    Posts
    103
    Reboot into single user mode, or runlevel 1. The root password is not required for this, you will be logged in as root automatically. Then issue the command "passwd" to reset the root password. Reboot back into your regular runlevel.

    This is the huge security hole in Linux, if you have physical access to the machine you can override GRUB/LILO to come up as single user or runlevel 1. No root password required !! The "fixes", such as they are, include (a) BIOS password to prevent booting from CD/floppy (can be overrode by a jumper setting usually, so also LOCK THE CASE) (b) set password on GRUB/LILO to prevent parameter override at boot time.

    You might also look at setting up "sudo" so that your regular user can login into root using your regualr user password.

    Have fun !

  11. #11
    Join Date
    Mar 2003
    Location
    Earth [I think...]
    Posts
    414
    This was covered a little while ago in a lot of detail.

    Here's links to tutorials in JL Help library:

    http://www.justlinux.com/forum/showt...hreadid=130939
    http://www.justlinux.com/forum/showt...hreadid=126393

    Hope these help.

    - Suramya
    --------------------------------------------------
    My Website: http://www.suramya.com
    My Blog: http://www.suramya.com/blog
    Registered Linux User #: 309391
    --------------------------------------------------

    *************************************************
    Disclaimer:
    Any errors in spelling, tact, or fact are transmission errors.
    *************************************************

  12. #12
    Join Date
    Apr 2001
    Location
    SF Bay Area, CA
    Posts
    14,947
    Originally posted by palinux
    Reboot into single user mode, or runlevel 1. The root password is not required for this
    That's not necessarily true.

    At least two distros that I've used set up single-user mode so that /sbin/sulogin runs, not just a shell. sulogin requires the root password before it will give you a root shell.

    However, there's still a security hole. Instead of booting to single-user mode, you can boot with init=/bin/bash instead. This will give you a root shell with no filesystems (other than the root) mounted, with no password prompts. I've used it a couple of times when my /sbin/sulogin program from the "shadow" package had been replaced by the one from "util-linux" (which didn't support shadowed passwords, so sulogin wouldn't accept any root password, because mine were shadowed).

  13. #13
    Join Date
    Dec 2002
    Posts
    1,008
    I did it the other day without chrooting. We copied (by hand) a crytpoed user password to the root spot in /etc/shadow. It worked, I was amazed!

  14. #14
    Join Date
    Jan 2003
    Posts
    979
    in fedora linux, during installation it will ask you for placing a GRUB password, to prevent any such thing from the boot screen. if you made it the same as the root password, you need to go to the BIOS to boot from a rescue/lice cd. if you put a BIOS password the same as the root one, then just break open your case.

  15. #15
    Join Date
    Dec 2002
    Posts
    1,008
    The lesson here is:
    Once local access is established by a unmonitored cracker, your finished.

Posting Permissions

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