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
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 are the mv command options?
What is the programming language for linux?
How can I check the exit status of my previous command in Linux operating system?
Brief about the command kill PID?
How do I find command history in linux?
What does (cd dir && command) do?
What is $@ in makefile?
How to activate / deploy licence in RHEL 6 and what will happen if you don't activate / deploy licence in RHEL 6 ?
What make install does?
Which command is used to delete a group?
How do I know my linux shell version?
How do you create a file?
Describe the mknod command and when you’d use it.
What is the difference between diff and cmp command in unix?