Results 1 to 10 of 10

Thread: Getting Root

  1. #1
    Member
    Join Date
    Mar 2002
    Posts
    42

    Getting Root

    Hi Everyone,
    The reason y i am posting here is that , last time i changed my linux system's password and now have forgotten the

    password.I have two harddisk , one contains win 98 and 2000 other harddisk have linux 8 kernel 2.4 with grub as boot loader.

    I have forgotten password for root account i had created an other account for using net i remember password for that. How can

    i get my roots password back. I cannt reinstall cause i have alot of files and configuration in root. And i had turned on

    password shadowing for security reasons. So now how can i get my root account back. Is it possible or not or i have to

    reinstall my linux system. I tried installing lilo but that dont get installed , instead deletes the boot loader. What can i

    do now. Thanks
    Always From Better to Best

  2. #2
    Sorry to say that I knew just a little about Linux.

  3. #3
    Member
    Join Date
    Apr 2003
    Posts
    95
    first off im relaively new to linux so im not 100% sure this will work but i think it does,
    If you have some form of backup medium ready. Then either install another distro of linux or get a linux boot cd (there are a few disto's that you can make a linux bootable cd, one i have is called "dynebolic" however a friend burned it to disk for me so i have no idea where to get it, however a google should turn that up easy) you can then boot the comp with the other distro of linux and use it to copy the needed files (and i would have thought config files too) to your backup medium. Once youve done that you should be ok to to re-install linux from scratch.

  4. #4
    Member
    Join Date
    Mar 2002
    Posts
    42
    If i can boot from cd and access linux partitiion and files , so i can change the /etc/passwd file and will change root:x:0:0 to root:0:0:0, it may work that way.
    But i dont wana delete my linux system, or it will take me a whole more day to install and configure it again. i had different development envirnoments there. is there any other solution. if i did not find any other solution i will then burn a cd. Thanks for the comment . other suggestion are welcome.
    Always From Better to Best

  5. #5
    Member
    Join Date
    Apr 2003
    Posts
    95
    I have no idea if this will work or not, but you may try editing the shadow file and copy the shadowed password from your normal user account to the root password section then use your normal password for the root account, Like i said i have apsolutely no idea wether that would work or not (I really hope a trick like that doesnt work!!) So dont blame me if you try it something goes wrong

  6. #6
    Member
    Join Date
    Mar 2002
    Posts
    42
    last time i added a new user with root previliges by adding line like user:0:0:0:.... and it logged me on , on my box. hope it will work , can you tell me the name of boot loader to burn or some more detail. and after booting from cd , do i have root previliges for the files.
    Always From Better to Best

  7. #7
    Senior Member
    Join Date
    Jun 2004
    Posts
    460
    first of all, grub and lilo are just boot loaders which means they tell the computer where the operating systems are and allows the computer to boot

    second of all, you don't just burn a "bootloader" to a cd... download a live distro like knoppix or damn small linux

    i have three possible ways where you can reset your password
    method 1
    1. Reboot your PC & when u see the loader screen just type 'e',
    U will see another boot screen like :-

    kernel boot.... / ... /LABEL=/
    press 'e' again ...

    2. Modify this line as :- (just type '1' after giving single space after "/LABEL=/" )
    i.e.
    kernel boot..... /LABEL=/ 1
    Press Enter....
    3. When u see again the second scren type 'b'.

    4. you will automatically go to the superuser prompt .... like
    sh-0.15 #
    just give command as :-
    sh-0.15 # passwd root
    linux will ask you for new password give it & reboot your machine....
    5. Next time login as a root... & as a root u can easily set or reset the password
    of all other user..

    if that doesn't work then try this
    method 2
    boot your computer from the Linux boot diskette or the CD. Then find your Linux root partition on the hard drive, mount it, and edit In the password file, erase the encrypted password for root (for example, using the pico editor), so it is empty.

    Information about a user accounts is kept in plain-text files: /etc/passwd and /etc/shadow.

    For example, an /etc/shadow entry for "root" account may look like this:

    root:$1$BuPbmLAz$1G7.evIChyqaEI0TlZp0F.:11071:0:99999:7:-1:-1:134540356

    and after the password is erased, it should look like this:

    root::11071:0:99999:7:-1:-1:134540356

    method 3
    because you mentioned trying to install lilo
    at the LILO prompt, you can go into the single user mode. If your normal boot image
    is called linux, then enter "linux single" or "linux init=/bin/bash" at
    the LILO prompt. The run passwd and set a new root password. After
    this, you will want to change to the normal run level, or reboot.
    [gloworange]find / -name \"*your_base*\" -exec chown us:us {} \\;[/gloworange] [glowpurple]Trust No One[/glowpurple][shadow] Use Hardened Gentoo [/shadow]
    CATAPULTAM HABEO. NISI PECUNIAM OMNEM MIHI DABIS, AD CAPUT TUUM SAXUM IMMANE MITTAM

  8. #8
    Senior Member DeadAddict's Avatar
    Join Date
    Jun 2003
    Posts
    2,583
    Boot linux into single user mode and then type linux single "linux single" (without the quotes) at the LILO command prompt; you'll go into single-user mode.
    then type in passwd and enter your new password

    If you use Grub as a boot manager.

    At boot, select the Linux distribution you want to boot into. When your selection is highlighted, hit the "e" key to edit the boot commands.

    Scroll down to the kernel command and type "e" to edit it. Go to the end of that line and type the word "single" (no quotes).

    Continue the boot. Instead of getting the GUI and X Window System windows manager, you'll get a simple little prompt that gives you full access to the system, including changing passwords.

    Once you're in single-user mode, you can change the root password with the "passwd root" (no quotes) command. Then you can reboot, go into X Window System, and change all the other user passwords as well. That's how you get back into a Linux system after you lose your password.

  9. #9
    Senior Member
    Join Date
    Jun 2004
    Posts
    460
    thanks for expanding on my single user mode explination
    [gloworange]find / -name \"*your_base*\" -exec chown us:us {} \\;[/gloworange] [glowpurple]Trust No One[/glowpurple][shadow] Use Hardened Gentoo [/shadow]
    CATAPULTAM HABEO. NISI PECUNIAM OMNEM MIHI DABIS, AD CAPUT TUUM SAXUM IMMANE MITTAM

  10. #10
    Member
    Join Date
    Mar 2002
    Posts
    42
    thanks djscribble i tried you 1st method and it worked. you saved alot of time . thanks every one for suggestions specially DeadAddict .
    Always From Better to Best

Posting Permissions

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