1837095 Members
2304 Online
110112 Solutions
New Discussion

/etc/passwd is removed

 
Mohammad Tharwat
Occasional Contributor

/etc/passwd is removed

The file /etc/passwd is renamed, so we can`t login to the system by any account, if there`s any trick to bypass the root password and retain the passwd file.
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor

Re: /etc/passwd is removed

I think that you can login by shutting down (in your case, that means plugging the plug) and then coming up in single-user mode.

Shutdown.
Power back up.
When you get the console prompt, press .
BOOT PRI
Interact with ISL? Y
ISL> hpux -is

That should bring you up as uid 0 without a prompt.
Next mount /usr.
You can then copy /usr/newconfig/etc/passwd to /etc/passwd.

Umount /usr
sync
and reboot.

If this fails, it's time to boot from your Recovery CD.
If it ain't broke, I can fix that.
Shine_5
Frequent Advisor

Re: /etc/passwd is removed

If your /etc/passwd got removed you can copy the /etc/opasswd file to /etc/passwd

Shine
Joe Robinson_2
Super Advisor

Re: /etc/passwd is removed

I'd seen this years back; what I did was reboot (w/ ISL) to single-user, then did:

cat root::(the rest of the root login line in /etc/passwd) > /etc/passwd

once there was a passwd file for root to log in, I changed the root pw, then was able to restore the original pw file.