Author Topic: How to recover  (Read 722 times)

hameedkm

  • Blue Belt
  • ****
  • Posts: 111
  • Karma: +0/-0
How to recover
« on: July 24, 2014, 10:33:10 PM »
hello,

How to recover /etc/passwd file and /etc/shadow file?

Thanks
hameed

afsalabdulla

  • Green Belt
  • *****
  • Posts: 218
  • Karma: +0/-0
Re: How to recover
« Reply #1 on: July 24, 2014, 10:34:14 PM »
hello,

## In that case you need to recover /etc/passwd file first.
For this you have to following steps,

-Start GRUB on boot (press ESC while booting)
-Press e over (recovery mode)
-Press e over the line beginning with kernel
-Press Space bar and enter "init=/bin/bash"
-Press enter
-Press b
-At command prompt type: "cp /etc/passwd- /etc/passwd"
-reboot to GRUB again
-Press e over (recovery mode)
-Press e over the line beginning with kernel
-Press Space bar and enter "init=/bin/bash"
-Press enter
-Press b
-At command prompt type "mount -o remount,rw /"
-Type "passwd YOURUSERNAMEHERE" (IF you don't know your user
name type "ls /home" (that is a Lower case L and lower case
S) for a list of users)
-Enter new password at prompt
-reboot to normal boot.

Hope that helps others like it did me!

### Then to recover /etc/shadow file, Use following command
pwconf

This command will generate /etc/shadow file from /etc/passwd

Thanks
afsal

PeterParker

  • White Belt
  • *
  • Posts: 12
  • Karma: +0/-0
Re: How to recover
« Reply #2 on: December 05, 2015, 11:22:34 AM »
solution, offered by afsalabdulla is really working, i've managed to recover in such way