LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Cannot Login /etc/shadow Files Deleted (https://www.linuxquestions.org/questions/linux-software-2/cannot-login-etc-shadow-files-deleted-578302/)

Peter_APIIT 08-19-2007 10:26 PM

Cannot Login /etc/shadow Files Deleted
 
Hello all expert Linux administrator, i have a very basic problem where i have deleted the /etc/shadow files. I not longer can login to multiuser mode and root user.

Any idea how to solved it ?

I hope you all can help me.

THanks for your help.

Your help is greatly appreciated by me and others.

MS3FGX 08-19-2007 10:32 PM

You would need to reinstall the file from the original packages (so that you have a sane file to build from) and then manually replace the data that had been removed; which would include the username/password of all users added since the machine was setup, and any passwords you have changed for built in users (such as root).

The easiest thing to do is boot the machine with a live CD (or the install CD, if it doubles as a live/rescue CD) and then edit the file that way. Where you are going to get the original file depends on which distribution you are running, which you did not specify.

Peter_APIIT 08-21-2007 07:49 AM

I using fedora 7. I not very understand what you say.

My understanding is boot from the live cd, and install the /etc/shadow file.

What i understand:
1. Boot to live cd.
2. Change the root password to previous install root password in the live cd environment and the normal user as well.
3. Install the /etc/shadow.

Is this correct ?

I don't know which file to choose to install ?

Thanks for your help.

Your help is greatly appreciated by me and others.

jay73 08-21-2007 09:34 AM

Alternative approach: install another Fedora 7 and copy over its /etc/password file. This should create the default settings; you may need to make additions for any users you added manually.

Peter_APIIT 08-24-2007 05:33 AM

Thanks for your help.

unSpawn 08-24-2007 06:31 AM

...and the entries for the daemons that where installed you can get with 'rpm -qa --scripts | egrep -A 3 "(user|group)add" > /tmp/rpmlogins'. /tmp/rpmlogins will contain the rough snippets, so with a little bit of shellscripting knowledge you can add those entries back in quickly.


All times are GMT -5. The time now is 08:36 AM.