Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Recovery of deleted /etc/passwd File in Linux  (Read 4896 times)

0 Members and 2 Guests are viewing this topic.

nirmal

  • Jr. Member
  • **
  • Posts: 56
  • Karma: +0/-0
Recovery of deleted /etc/passwd File in Linux
« on: November 17, 2013, 04:14:53 pm »
Hi all,

Recovery of deleted /etc/passwd File in Linux

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.

Thank you

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
Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!