Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

In my linux machine, i lost /etc/passwd file
and /etc/shadow file, then how can i recover it?

Answer Posted / sachinmali17

## In that case you need to recover /etc/passwd file first.
For this you have to following steps,

-Start GRUB on boot (press ESC while booting)
-Press e over (recovery mode)
-Press e over the line beginning with kernel
-Press Space bar and enter "init=/bin/bash"
-Press enter
-Press b
-At command prompt type: "cp /etc/passwd- /etc/passwd"
-reboot to GRUB again
-Press e over (recovery mode)
-Press e over the line beginning with kernel
-Press Space bar and enter "init=/bin/bash"
-Press enter
-Press b
-At command prompt type "mount -o remount,rw /"
-Type "passwd YOURUSERNAMEHERE" (IF you don't know your user
name type "ls /home" (that is a Lower case L and lower case
S) for a list of users)
-Enter new password at prompt
-reboot to normal boot.

Hope that helps others like it did me!

### Then to recover /etc/shadow file, Use following command
pwconf

This command will generate /etc/shadow file from /etc/passwd


Is This Answer Correct ?    17 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What the command used for list the contents of your home directory, current directory and all subdirectories?

925


Information technology is widely used in

1834


What does make clean command do?

966


What is the best cpu stress test?

898


Explain shift command of linux?

1043


In order to display the last five commands you have entered using the fc command, you would type?

900


Suppose I lost a root password and I need to give it, I treid to change it through single usermode even though I am not get a password, then what is the otherprocedure to give a root password?

914


What are the mv command options?

830


What is the purpose output of cd command?

1000


How do I check my disk space?

903


How can you copy lines into the buffer in command mode?

1020


What is the use of finger command in linux?

946


What does grep grep do?

869


How do I check cores in linux?

1017


What is whois command?

1018