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
What is the difference between command ‘ping’ and ‘ping6’?
Write a command that will do the following: -look for all files in the current and subsequent directories with an extension c,v -strip the,v from the result (you can use sed command) -use the result and use a grep command to search for all occurrences of the word orange in the files.
Which of the commands will replace all occurrences of the word rate with the word speed in the file racing?
What does sh do in linux?
What is the difference between locating and locate command?
What is the programming language for linux?
What does && mean in bash?
Explain difference between nfs soft and hard mouniting points?
what is the fastest way to enter a series of commands from the command-line in linux
What is tty in linux command?
What is a ulimit in unix?
How do you create a text file in linux?
What are the basic command in linux?
What are the basic commands in command prompt?
What is the command to delete a file linux?