Deleted /etc/passwd | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Deleted /etc/passwd

UNIX for Dummies Questions & Answers


Tags
linux

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-07-2002
cyno cyno is offline
Registered User
 
Join Date: Aug 2002
Last Activity: 6 February 2004, 11:43 AM EST
Location: Louisiana
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Bug Deleted /etc/passwd

Hi all,
While playing with my LINUX machine i accidently deleted a file name called /etc/passwd . Even though the system is booted am unable to get the login prompt. Is there any remedy for this problem.
Sponsored Links
    #2  
Old 08-07-2002
cerberusofhate
Guest
 
Posts: n/a
yeah, boot from a boot cdrom and go into recovery mode (assuming that you use your distro's cdrom for this). Then, mount your old drive:
mkdir /olddrive
mount /dev/hda5 /olddrive
assuming that your old drive is on /dev/hda5.
then, cd to /olddrive/etc
type:
echo "root::0:0:Superuser:/:/bin/bash" > passwd
then reboot. That will set no passwd for root. Then, you can login, create all of your accounts over again, etc. BTW, some distros might have made a backup for you called passwd.old or something similar, check it out
Sponsored Links
    #3  
Old 08-08-2002
binhnx2000's Avatar
binhnx2000 binhnx2000 is offline
Registered User
 
Join Date: Jul 2002
Last Activity: 18 January 2010, 12:26 PM EST
Location: France
Posts: 78
Thanks: 0
Thanked 5 Times in 1 Post
Hammer & Screwdriver

You can use Floopy Boot Disk (FBD) to Boot on Linux. After restore /etc/passwd from FBD or from file backup /etc/passwd.bak

Good Luck
    #4  
Old 08-08-2002
cyno cyno is offline
Registered User
 
Join Date: Aug 2002
Last Activity: 6 February 2004, 11:43 AM EST
Location: Louisiana
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for both of u. After my extenuating work with my system atlast i got my login prompt back.
take care
Sponsored Links
    #5  
Old 08-08-2002
raju
Guest
 
Posts: n/a
Quote:
"take care"
hi cyno..., with reference to above who should be taking care...(of ur etc/passwd file)
binhnx2000 or cerberusofhate.... ..hhmmmm
just joking ,
bye..
Sponsored Links
    #6  
Old 08-11-2002
stime stime is offline
Registered User
 
Join Date: Aug 2002
Last Activity: 17 March 2008, 9:05 PM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
cp and older copy ?

most linux distro's make copies of passwd
and call them passwd- or passwd.bak
most bsd's make a backup of the complete /etc dir
try some stuff like ls passwd* in /etc
let me know, and good luck
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Passwd,shadow files deleted and abort sequence disabled satish51392111 Solaris 9 05-22-2012 10:05 AM
When did AIX start using /etc/security/passwd instead of /etc/passwd to store encrypted passwords? Anne Neville AIX 1 03-09-2012 08:05 PM
passwd cmd reenables passwd aging in shadow entry BG_JrAdmin Solaris 3 01-04-2011 03:28 PM
how to get passwd command again if it is deleted by usin rm command venkata.ganesh Linux 5 02-13-2009 10:56 AM
/etc/passwd file been deleted gera_sachin125 Solaris 5 02-11-2008 12:36 PM



All times are GMT -4. The time now is 02:01 PM.