I was going through my network security notes and fiddling through my system .
Accidentally, I deleted my /etc/shadow
file ( file that store encrypted value of /etc/passwd ). Currently, I am on my system as I can't logout ( if I do I will loose it forever).
So now I have /etc/shadow-
and /etc/passwd
on my system. Can anyone tell me how to generate or get my shadow file back. I don't want to delete this OS.
I have looked for its answer on stackoverflow or other ubuntu forum nothing has came close to solve this issue.
Asked
Active
Viewed 455 times
-2

abby37
- 597
- 6
- 21
-
Can I use pwconv command ?? but it is asking for password as I have to run it in sudo mode. Thing is it is not accepting any password now (due to missing of shadow file) – abby37 Feb 28 '17 at 13:31
-
This is well known and asked several times. No there is no way to recover deleted files in general. See http://stackoverflow.com/questions/26721491/how-to-recover-the-deleted-files-using-rm-r-command-in-linux-server/26721623#26721623 for example. Sometimes, you can try to stop the system, use some special tool to analyze the disk and recover deleted files (but there is NO guarantee that it will work). – Jean-Baptiste Yunès Feb 28 '17 at 19:08
-
Possible duplicate of [How to recover the deleted files using "rm -R" command in linux server?](http://stackoverflow.com/questions/26721491/how-to-recover-the-deleted-files-using-rm-r-command-in-linux-server) – Jean-Baptiste Yunès Feb 28 '17 at 19:08
-
Now I have found that my `shadow` file is renamed as `CAR`. How can I rename it again without using sudo command in `/etc` folder. – abby37 Mar 01 '17 at 01:02
1 Answers
0
Due to exam pressure , unable to think how to respond to this issue. But if any one get struck with Ubuntu system file failure or accidental deletion. Just boot an OS through pendrive and move the file to desired location, which I did. If you have dual boot, problem more easier to solve as just go to other OS access your hard drive and make necessary changes.

abby37
- 597
- 6
- 21