1832251 Members
2625 Online
110041 Solutions
New Discussion

/etc/passwd file corrupt

 
chetana07
Frequent Advisor

/etc/passwd file corrupt

In HP-UX 11i,in non-trusted domain systems,if /etc/passwd file corrupts wht should one do to recover it?
8 REPLIES 8
V. Nyga
Honored Contributor

Re: /etc/passwd file corrupt

Hi,

restore the password file from the backup.
Else try 'pwck' (see 'man pwck') or use SAM to check/change for things/nonprintable characters in the passwd file.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Vihang.
Trusted Contributor

Re: /etc/passwd file corrupt

Hi Chetana,

Best thing would be to recover the /etc/passwd file from backup.


Regards,
Vihang.
Kenan Erdey
Honored Contributor

Re: /etc/passwd file corrupt

hi,

if backup does not exits and there exists same passwd file in another server, perhaps you can ftp, or boot from recover cd and restore a passwd file from scratch.
Computers have lots of memory but no imagination
sreekanthtm
Trusted Contributor

Re: /etc/passwd file corrupt

R u able to login to the server as root?
Do you have back up of /etc/passwd file?
If yes, then restore it.
If you don't have a back up, then try to recreate the passwd file. Look in to any other server for structure of passwd file. Look in the /home directory to get the username.

But If there is more no: of users with complex usage of user ID and group ID's, its difficult.
Sandeep_Chaudhary
Trusted Contributor

Re: /etc/passwd file corrupt

run pwck on /etc/passwd
SKR_1
Trusted Contributor

Re: /etc/passwd file corrupt

You can copy the /etc/passwd file from another server and edit according the users you have on same box.

Then do vi /etc/passwd & create new file


Thanks

SKR
James R. Ferguson
Acclaimed Contributor

Re: /etc/passwd file corrupt

Hi:

Not having a backup of critical configuration files is very poor admimistration, I'm sorry to say. If you cannot run 'pwck' as noted or munge the corruption, you can always find a "starter" file as:

'/usr/newconfig/etc/passwd'


Regards!

...JRF...

Vishu
Trusted Contributor

Re: /etc/passwd file corrupt

Hi,
/usr/newconfig is the best to have a fresh format of /etc/passwd. so, better try it and edit accordingly.