Q8 Linux System Recovery (/etc/passwd) Flashcards

(1 cards)

1
Q

Suppose you have installed a GNU/Linux system on a hard drive.
One day you accidentally deleted the file /etc/passwd but you rebooted the system before you realised the mistake.
No one can log into the system now.
But luckily you have a backup of the file on a different machine.

Explain how you can fix the problem without reinstalling the whole system.

A

Problem: /etc/passwd is essential for user authentication and defining user environments (home direc, login shell).
- Without it system utilities like login cannot determine valid users, preventing normal login access

Solution: to fix without reinstalling, access file system from outside broken installatio to restore backup.

1 - boot from live cd/usb
2 - identify and mount root partition
3 - transfer backup of /etc/passwd to /mnt/etc/passwd
4 - verify permissions and ownership
5 - unmount and reboot.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly