Operating System - HP-UX
1827894 Members
1540 Online
109969 Solutions
New Discussion

Regenerating userids from /etc/shadow file

 
SOLVED
Go to solution
Sauvik Basu
Advisor

Regenerating userids from /etc/shadow file

Hi,
The /etc/passwd file was deleted by mistake.However,I had shadowing enabled.I have restored the root account and other system accounts.Is it possible anyway to regenerate the previous /etc/passwd file from the /etc/shadow file?
Thanks in advance,
Sauvik Basu.
5 REPLIES 5
Solution

Re: Regenerating userids from /etc/shadow file

Hi,

don't you have any ignite backup to recover the passwd file?

Regards,

Alfredo
Rick Garland
Honored Contributor

Re: Regenerating userids from /etc/shadow file

You can get the account names and encrypted passwd, but UID, GID, $HOMEDIR are not in there. Might be easier to restore the /etc/passwd from a backup.

A. Clay Stephenson
Acclaimed Contributor

Re: Regenerating userids from /etc/shadow file

No, /etc/shadow contains only a subset of the needed data. Your best bet is to restore from backup.
If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor

Re: Regenerating userids from /etc/shadow file

Not really. The shadow file keeps a subset of information from the /etc/passwd file.

The shadow file does not have the UID, GID, GECOS info (comment field), home directory or default shell.

Your best bet really is to restore from a backup of some sort.
Sauvik Basu
Advisor

Re: Regenerating userids from /etc/shadow file

Thanks.