Lock down /etc/passwd

Linux lab Beginner 2 tasks 10 points

/etc/passwd is world-writable on this box — anyone could add a root account.

Check its permissions, then restore them to the safe default of 644.

How it works: the terminal below is a real Linux machine running in your browser. Click it and type. Tasks tick themselves off as you complete them; questions are answered in the box under each task. Press Reset any time for a fresh machine. Your password on this machine (for sudo) is student.

student@vulntech:~ Starting…
Getting your Linux machine ready…
The first start downloads about 20 MB. After that your browser keeps it, and labs start in a moment.

Hints

`ls -l /etc/passwd` shows it is writable by everyone (666).

`sudo chmod 644 /etc/passwd` makes it root-only for writes.

Solution explanation

A world-writable /etc/passwd is a game-over misconfiguration — anyone can append a UID-0 account and su to it. sudo chmod 644 /etc/passwd restored the safe default: everyone may read it, only root may change it. Account-database files are among the first things to verify on any host.

Show solution
cd /home/student
ls -l /etc/passwd
sudo chmod 644 /etc/passwd
ls -l /etc/passwd
HOME LABS COMMUNITY DASHBOARD