Find the answer to your Linux question:
Results 1 to 10 of 10
i forgot my user password and tried reseting it but couldn't with error, but while in root i stupidly deleted passwd and passwd- files now i can't boot up. i ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2011
    Posts
    5

    Red face recovery after deleting passwd & passwd-


    i forgot my user password and tried reseting it but couldn't with error, but while in root i stupidly deleted passwd and passwd- files now i can't boot up.

    i used a recovery disk and copied the passwd and passwd- files back on to the /etc directory and i still can't boot into my machine it doesn't reach login screen, just hangs with fedora image.

    i'm using fedora 15.

    i do realise how stupid it was to mess around in root. i don't know what came over me!

    Any help would be greatly appreciated.

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,758
    Good news is - Its a solvable issue.
    Did you try start using single user mode? When GRUB menu comes up Press "e" for edit then move (using downarrow key) to the line like
    kernel /vmlinuz-2.6.31.9-174.fc12.x86_64 ro root=/dev/mapper/vg_space-lv_root LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
    Press e again and append "single" to it so that result will be like
    kernel /vmlinuz-2.6.31.9-174.fc12.x86_64 ro root=/dev/mapper/vg_space-lv_root LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet single
    and Press "Enter" .Now press "b" ..see whether that solves the issue.


    I hope you deleted only /etc/passwd not all files under /etc/ right?
    When It boots up press "ctrl + alt + f1" and press I for interactive login ..that will help us know where exactly the boot process hangs.

    HTH
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  3. #3
    Just Joined!
    Join Date
    Aug 2011
    Posts
    5

    recovery

    Thanks for the reply!!

    i had done what you asked and here are the details of where it hangs!

    Code:
    Starting Avahi mDNS/DNS-SD Stack failed, see 'systemct1 status avahi-daemon.service' for details.
    
    Starting ABRT Automated Bug Reporting Tool Failed, see 'systemctl status abrtd.service' for details.
    
    Started D-Bus system Message Bus.
    Then it just hangs here!! ANymore advice would be greatly appreciated.

    Oh i have also reset root password but that should not affect things.

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,758
    Okay.Here is my guess ,from where did you copy the passwd file? Have you copied from Live-CD ?

    Because on my Fedora 12 machine - I can see entries like

    avahi-autoipd: something here :/sbin/nologin
    dbus: something here :/sbin/nologin
    So I guess dbus entry may not there in your password file?

    I would suggest your copy passwd file from other similar F15 machine and use it your machine.
    Another thing would be - Start in a interactive mode press "I" after ctr+aft+f1 , when it comes to these service say "n" and then we see whether gets into login process.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  5. #5
    Just Joined!
    Join Date
    Aug 2011
    Posts
    5

    recovery

    Thanks again for reply.

    CRt-Alt-F1 doesn't seem to do anything! but i did see the start up from crt-alt-i !!

    I did copy the passwd and passwd- files from a live cd the shadow files stayed the same!

    I do not have another PC with fedora 15 here now. But i do have a friend that uses fedora 15. i can visit him tonight!

    For some resaon i can't start interactive mode to say 'n' to anything.

    I'll be more careful when using root in future. i do not know what made me do this in the first place, perhaps sheer stupidity.

    i hope this can be sorted out soon as i'm in need of my fedora 15 to do a linux course!

    This has helped me learn! i will eb more carefull with what i do in future.

  6. #6
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    You can get a working copy of your /etc/passwd file from the setup package, too:
    Code:
    cd /tmp
    wget http://download.fedora.redhat.com/pub/fedora/linux/releases/15/Fedora/i386/os/Packages/setup-2.8.31-2.fc15.noarch.rpm
    rpm2cpio setup-2.8.31-2.fc15.noarch.rpm > setup-2.8.31-2.fc15.noarch.cpio
    mkdir /tmp/foo
    cd /tmp/foo
    cpio -idv < ../setup-2.8.31-2.fc15.noarch.cpio
    A starting /etc/passwd file should now be /tmp/foo/etc/passwd. If you then reinstall dbus, etc., those accounts should get re-created (though you may have to rpm -e --justdb <packagename> first to trick yum into reinstall installed packages).

  7. #7
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,758
    I don't why the hangs at that point ..it may be due to wrong entries in passwd file or something else.

    Some time back,I deleted entire /etc/ directory and recovered my system back by installing new OS on separate partition and copying appropriate files - It took some time to complete this process. But these things do happen
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  8. #8
    Just Joined!
    Join Date
    Aug 2011
    Posts
    5
    Atreyu- IS this possible with out an internet connection? i need to log in to browser to start a connection on my machine! Thanks for the reply.

    LAkshmipathi- thanks for your help i do not want to go as far as this to save my system perhaps i will just do a fresh install over the top of everything! WOuld be better to get it working without doing this though.

  9. #9
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    I'm not sure what you mean about internet connection. Clearly you have one...you can download the RPM via whatever you're using to surf now, then copy it to your Linux box (burn to CD, USB thumbdrive, etc.). Then proceed with the rest of the steps, after the wget command.

    You can also get the file off the original F15 installation media, if you happen to have that lying around.

  10. #10
    Just Joined!
    Join Date
    Aug 2011
    Posts
    5
    AH silly me why didn't i think of that! RPM's are like Debs i'll give it a try later and get back to you!! Thanks for your help it is very much appreciated.

Posting Permissions

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