Big trouble--/etc/passwd is hosed!

Big trouble--/etc/passwd is hosed!

Post by Jaso » Sun, 26 Jul 1998 04:00:00



I figured this out when trying to log in this morning, and
couldn't.  Does anyone know of a workaround so I can get this
file back?  My apologies if this is a FAQ.
I was planning on re-installing a newer distribution
(have Slackware 3.0 now), but not this soon!!!

Thanks for any assistance.

 
 
 

Big trouble--/etc/passwd is hosed!

Post by Andy Jefferso » Sun, 26 Jul 1998 04:00:00



> I figured this out when trying to log in this morning, and
> couldn't.  Does anyone know of a workaround so I can get this
> file back?  My apologies if this is a FAQ.
> I was planning on re-installing a newer distribution
> (have Slackware 3.0 now), but not this soon!!!

Boot up in single-user mode maybe ? At LILO type

linux single       (instead of linux).

This instructs init to not start all of the usual daemons and go
into runlevel 1.

You should be able to get in as root then I think

HTH
--
Andy Jefferson

 
 
 

Big trouble--/etc/passwd is hosed!

Post by Mike Kin » Sun, 26 Jul 1998 04:00:00



> I figured this out when trying to log in this morning, and
> couldn't.  Does anyone know of a workaround so I can get this
> file back?  My apologies if this is a FAQ.
> I was planning on re-installing a newer distribution
> (have Slackware 3.0 now), but not this soon!!!

> Thanks for any assistance.

Are you sure it's passwd that's hosed?If you have a Linux floppy boot
disk (you should have for times like these) youcan try:
boot on floppy
mount / (root on hard drive)
edit /etc/shadow to remove password for root.

Of course if the problem is with passwd, Take two asprin and ......

 
 
 

Big trouble--/etc/passwd is hosed!

Post by Jaso » Mon, 27 Jul 1998 04:00:00



> I figured this out when trying to log in this morning, and
> couldn't.  Does anyone know of a workaround so I can get this
> file back?  My apologies if this is a FAQ.
> I was planning on re-installing a newer distribution
> (have Slackware 3.0 now), but not this soon!!!

> Thanks for any assistance.

Thanks in part to a couple suggestions here and consulting the
trusty "Running Linux", I was able to get /etc/passwd back:

1) Made new "bare" boot and root floppies from the CD-ROM via DOS.
2) Booted up linux.  Then loaded the root disk.
3) mount -t ext2 /dev/hda3 /mnt (mounting hard drive)
4) cd /mnt/etc; ls  (luckily, last time passwd was changed, its
previous state was saved in passwd.old)
5) cp passwd.old passwd
6) fixed up passwd file to current state
7) Sigh of relief.

Phew!