How to recover /etc/passwd file and /etc/shadow file?
Submitted by: Administrator## 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
Submitted by: Administrator
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
Submitted by: Administrator
Read Online Linux Commands Job Interview Questions And Answers
Top Linux Commands Questions
☺ | What is the command to check wwn # in linux? |
☺ | What is vnc? |
☺ | Explain Difference between swap partition and swap file? |
☺ | What is lilo? How it is useful in linux? |
☺ | How to hide the partition in GRUB booting? |
Top Linux OS Categories
☺ | Device Drivers Interview Questions. |
☺ | Linux OS Management Interview Questions. |
☺ | Linux Makefile Interview Questions. |
☺ | Linux Environment Interview Questions. |
☺ | Linux OS Shell Interview Questions. |