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?

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / rallapalli

Enter into single user mode
$cp /etc/passwd~ /etc/passwd
$cp /etc/shadow~ /etc/shadow

passwd~ and shadow~ are backup files of passwd, shadow

Thanks,

Is This Answer Correct ?    4 Yes 1 No

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

Answer / venkat

Normally in linux we must have backup by default for
/etc/passwd and /etc/shadow files

/etc/passwd ---> /etc/passwd-
/etc/shadow ---> /etc/shadow-

from there we can copy or restore. If both are not available.
Then follow below steps:
1. reboot
2. Single user mode [ single init=/bin/bash ]
3. pwconv
4. check /etc/passwd and /etc/shadow files are there
5. sync
6. init 3 or reboot with init 3

Is This Answer Correct ?    3 Yes 1 No

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

Answer / inam

Recovery of passwd & shadow file

-write on kernel line "init=/bin/bash

-Press enter
-Press b
copy /etc/passwd- /etc/passwd

then use command
pwconf to regenerate shadow from passwd.


u can change password of ur user until u create shadow.

after all these changes just change ur user password with

-passwd username.

( i post one before but it has some mistake)
this opne will work try out

Is This Answer Correct ?    2 Yes 1 No

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

Answer / anil kumar

1. reboot
2. singal user mode (init=/bin/bash)
3. pwconv
4. check /etc/passwd and /etc/shadow files are there
5. sync
6. init 3

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Linux Commands Interview Questions

What does history command do in linux?

0 Answers  


Please send Security on linux related questions and answers.

0 Answers   Linux,


How do I find the linux version?

0 Answers  


I have Laptop. I want to assign DHCP ip address, but in my Laptop having Wireless and with wire NIC cards, it is possible to assign reserve ip address for both NIC card, but same host name?

4 Answers   AOL,


What command you use for cpio to create a backup called backup.cpio of all the users’ home dirs?

2 Answers  


How do I check if my cpu is overclocked?

0 Answers  


why context switching time should be minimum? How it depends on hardware support?

0 Answers   Flipkart,


What does uname command do?

0 Answers  


What are the files to be used in the network installation of linux os?

4 Answers  


What is the role of the Linux kernel?

1 Answers  


You wish to restore the file memo.ben which was backed up in the tarfile mybackup.tar. What command should you type?

0 Answers  


What are the examples of simple command?

0 Answers  


Categories