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
Is a command a full sentence?
What are the options of wc command?
What does df command do in linux?
You issue the command head * what would the resulting output be?
What does rmdir do in linux?
What is df command in linux?
You have a tab delimited file called phonenos and want to change each tab to four spaces. What command can you use to accomplish this?
What is command to check ports running/used over local machine
What is clang format?
How do I move to root in linux?
How to hide the partition in grub booting?
If the programmer wishes to execute an instruction at the specified time. Which command is used?
What the command used for list the contents of your home directory, current directory and all subdirectories?
How can you check the amount of lines in a file?
How do I know my linux shell version?