Page 1 of 1

File recovery

PostPosted: Fri Jan 30, 2015 10:58 am
by Karthik M Nair
i lost /etc/passwd file.how can i recover it?

Re: File recovery

PostPosted: Fri Jan 30, 2015 1:23 pm
by SIbinPhilip
Hello Karthick,

You could easily recover the /etc/passwd file in your system. Follow the steps mentioned below.

1. Restart your system and when restarting boot into single user mode.

If you don't know how to boot into single user mode follow these steps

a). At the time of booting process starts press ESC key to enter OS selection menu.
b). Here highlight the OS using arrow keys and then press E to edit it.
c). Select the second line containing information regarding kernel parameters. Now again press E to edit these kernel parameters.
d). Once we have entered into parameter editing mode type 1 or s or single after a space and then press ENTER key.
e). Now press B to boot the system in the single user mode.

2. Once you are there all you need to do is running following command- cp /etc/passwd- /etc/passwd and your problem is solved.
(/etc/passwd- is simply the backup of /etc/passwd and you can use it in case the original file is gone.)