Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
i have linux with grub loader how can i change or recover root password. plz help....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2003
    Posts
    36

    recovering or changing root password


    i have linux with grub loader how can i change or recover root password.
    plz help.

  2. #2
    Linux User
    Join Date
    Feb 2003
    Location
    Norway, Asker
    Posts
    267
    im not shure abut this, but cant you boot up in single and typ "passwd root"?
    in lilo, there is ex Linux 1
    maybe something similar at grub?

  3. #3
    Just Joined!
    Join Date
    Mar 2003
    Posts
    36
    Quote Originally Posted by Kriss
    im not shure abut this, but cant you boot up in single and typ "passwd root"?
    in lilo, there is ex Linux 1
    maybe something similar at grub?
    no in lilo u can go to textual mode by pressing cntrl+x but how can v go to textual mode in grub loader...

  4. #4
    Linux User
    Join Date
    Feb 2003
    Location
    Norway, Asker
    Posts
    267
    dontn know, but im shure dolda knows

  5. #5
    Just Joined!
    Join Date
    Mar 2003
    Posts
    36
    Quote Originally Posted by Kriss
    dontn know, but im shure dolda knows
    ok then waite 4 dolda response..

  6. #6
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    To recover your root-password, boot up linux in singleusermode. If you are using lilo as a bootloader you abort bootup with ctrl+x then use you tab-button to se which kernels you have availeble to boot on then execute:

    Code:
    <kernelname> 1 like this&#58;
    linux 1
    The use the passwd command to change you root password

    Code:
    passwd root
    If you are using grub, you have to edit the line on bootup and put 1 efter your kernelname like above, to boot to singleusermode. Remember to remove the 1 after you have successfully changed your password.

    Regards

    Regards

    Andutt

  7. #7
    Linux Newbie
    Join Date
    Apr 2003
    Location
    UK, Manchester
    Posts
    147
    On just about all distro's I have used booting into runlevel one still prompts for roots password.
    The best way to resolve the problem is to boot off a boot disk like tomsrtbt, mount the partition that contains the /etc/passwd file and edit it so that root no longer has a password. Reboot, login as root with no password and set it to whatever.

  8. #8
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    You dont have to use a bootdisk for theese kind of things, i have done this on both RH and Mandrake with success.

    Regards

    Regards

    Andutt

  9. #9
    Linux Newbie
    Join Date
    Apr 2003
    Location
    UK, Manchester
    Posts
    147
    Well I just tried on my debian (woody) box at home and you cant enter run level one without the root password so your solution does not hold true for all distributions.
    I will try on my RH servers at work but I am sure the latest versions also prompt for roots password. An older version of RH (6.2 Zoot I think) that I have running allows it though.
    I will confirm on monday when I am back at work.

    What versions of RH and Mandrake have you done this on ?

  10. #10
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    It works on all RH versions that I've tried it on. That is 7.1, 7.3 and 8. I haven't tried 9 or 6.1, though. I'm sure that this doesn't hold true for all distros, but it's still easily remedied, as long as your boot loader isn't restricted.
    You just have to add "init=/bin/sh" to the kernel command line to boot a shell as the init process. Then, if your /etc or /usr is on another filesystem, you will, of course, need to mount them first. If your /etc is in the root filesystem, remount it with write support using "mount -o remount,rw /", so that /etc/passwd can be written to. Then run "/usr/bin/passwd root" (/usr/bin won't be in your PATH at this point, so you'll have to specify it explcitly).
    You all seem to know how to do this with LILO, so all I can say is that if you're still using LILO, switch to GRUB ASAP; you won't regret it. It is as they say, LILO is the boot loader that everyone uses but noone likes. Of course, the first part of that statement isn't really true anymore, but that wasn't really important. </ranting> =)
    Using GRUB, do as andutt said. Just to clarify a bit: At the boot menu, select the boot option that you usually use, press e to enter edit mode, find the line beginning with "kernel", and then add any cmdline options that you want (such as 1 or init=/bin/sh). Then return to the edit menu and press b to boot. All keypresses are referenced at the bottom of the screen, so you don't have to remember them.

    And btw., andutt, you don't have to remove the 1 afterwards; GRUB doesn't save it since it doesn't implement write access for any file systems. Only LILO can save kernel command lines, and it only does it if you've configured it to do that.

Page 1 of 2 1 2 LastLast

Posting Permissions

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