Recovering of -etc-passwd file and -etc-shadow file

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

E

Expert

Verified

In that case you have to recover /etc/passwd file primary. For this you need to follow these steps,

  • Begin GRUB on boot (press ESC whereas booting)
  • Press e over (recovery mode)
  •  Press e over the line starting along with kernel
  • Press Space bar & 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 and lower case S) for a list of users)
  • Enter new password at prompt
  • reboot to normal boot.

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

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

   Related Questions in Science

©TutorsGlobe All rights reserved 2022-2023.