SUMMARY: Missing or corrupt /etc/passwd on Solaris 2.5.1

From: Rodney Wines (rodney.wines@ahqps.alcatel.fr)
Date: Thu Nov 20 1997 - 12:34:46 CST


Many thanks to the dozens of people who replied:

> The subject line says it all. I've got a SparcServer 20 that is now a
> "no account" system for reasons I haven't been able to determine. I
> arrived at work this morning to find it this way. The system will boot,
> but it can't find any of the accounts, not even "root". I've been unable
> to even boot to single user mode, because it asks for a maintenance
> password. Is there any way I can recreate /etc/passwd short of
> reinstalling Solaris? I don't have an extra disk to install a minimum OS
> on, and the system disk for my system is an internal drive, so I can't
> easily mount it on another system.

The problem occurred because what appears to be a piece of in.ftpd replaced
my /etc/passwd file. The modification time was 03:14 this morning.

I got in by booting from the Solaris 2.5.1 CDROM:

        boot cdrom

I then answered the preliminary questions for doing the Solaris upgrade;
hostname, IP address, network mask, time zone, etc. At that point, I was
given the option of exiting the procedure, and that gave me the "#" prompt.
My root filesystem was mounted as "/a", so I just hacked "/a/etc/passwd" and
rebooted. My system is a SparcServer, not a SparcStation, so I couldn't
just create another window when the installation script started. I didn't
try ctrl/d ...

Hacking the password file was fun, because I couldn't even get vi to work.
I did create a "root" account without a password at all, but I still
couldn't log in. So, I added the root password from /etc/shadow, and
I was back in business. I later discovered that I should've just given root
a password of "x", and the system would've used the shadow password
automatically.

Several people told me that I could've also done:

        boot cdrom -sw

or
        boot cdrom -s

This would take me directly to a shell, and I could then mount my "/"
filesystem on "/mnt", or wherever I wanted it, and I wouldn't have to bother
with the Solaris installation script, but I had fixed my problem before I
got this suggestion, so I didn't try it.

Again, I appreciate the help.

Rodney



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:09 CDT