LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-19-2007, 10:26 PM   #1
Peter_APIIT
Member
 
Registered: Dec 2006
Posts: 606

Rep: Reputation: 31
Thumbs up 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.
 
Old 08-19-2007, 10:32 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
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.
 
Old 08-21-2007, 07:49 AM   #3
Peter_APIIT
Member
 
Registered: Dec 2006
Posts: 606

Original Poster
Rep: Reputation: 31
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.
 
Old 08-21-2007, 09:34 AM   #4
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
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.
 
Old 08-24-2007, 05:33 AM   #5
Peter_APIIT
Member
 
Registered: Dec 2006
Posts: 606

Original Poster
Rep: Reputation: 31
Thanks for your help.
 
Old 08-24-2007, 06:31 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
...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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mepis, copy files to thumb drive, files deleted? vremenno Linux - Newbie 6 09-15-2006 11:21 PM
LXer: Recovering deleted /etc/shadow password file LXer Syndicated Linux News 0 12-21-2005 03:46 PM
verifying a login w/ /etc/shadow exodist Linux - Security 4 11-17-2005 01:20 PM
Login Process & Security of /etc/passwd and /etc/shadow arut Solaris / OpenSolaris 3 12-27-2004 01:13 PM
How are shadow files updated? bleistein Linux - Security 1 08-01-2003 12:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration