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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which of the following tasks cannot be accomplished with the touch command?

556


How do you save a file in linux?

569


Is llvm a compiler?

546


What does uname do in linux?

541


How can I create a file with cmd?

532






Explain trap command; shift command, getopts command of linux?

565


Brief about the command kill PID?

592


How do I check terminal history?

516


What does top do in linux?

515


How do I check my disk space?

473


What is the gcc command?

520


What does chmod 777 do?

590


How do I check cores in linux?

537


What is echo command in batch file?

589


Which command is used to clear the screen?

546