Ravi Sir's Cyber Security Cards › Interview Cards
What is wrong with chmod 777 /var/www/html?
What is wrong with chmod 777 /var/www/html? 777 makes the web root writable by everyone, so any local user (or a web foothold) can change your site files. Use correct ownership and 755 for folders, 644 for files. The web user should not write, except to jailed upload folders. “777 on the web root in

Read card text
What this card says
Short answer
777 makes the web root writable by everyone, so any local user (or a web foothold) can change your site files.
Better way
Use correct ownership and 755 for folders, 644 for files. The web user should not write, except to jailed upload folders.
Say it in the interview
“777 on the web root invites defacement and webshells. I use 755/644 and tight ownership.”
Why it matters
World-writable web roots are a classic path from a small foothold to a full site takeover.
Learn more in the lesson: 46.3 Linux on EC2 Interview Questions