Linux File System and Permission Model Checklist
Many website problems are permission problems. WordPress cannot write uploads, Nginx returns 403, backups fail, scripts cannot run or malware spreads because permissions are too open. This checklist explains the Linux file system and permission model in a practical way.
Core principle
Every file has an owner, a group and permission rules. A service can only read, write or execute files if its running user has the right permission.
Checklist
- Identify the website root path.
- Check file owner and group.
- Check directory permissions.
- Check file permissions.
- Identify which user runs Nginx or PHP-FPM.
- Confirm WordPress can write only where needed.
- Avoid 777 permissions.
- Check uploads, cache and backup folders.
- Fix ownership carefully.
- Test website after permission changes.
Reusable lesson
Permissions are security and functionality at the same time. Too strict breaks the site. Too open increases risk.
When to Use This Checklist
Use this checklist when fixing 403 errors, upload failures, backup failures, cache permission problems or WordPress file ownership issues.
Required Tools
SSH access, website root path, Nginx or PHP-FPM user, ls, chmod, chown, backup before changes
Before You Start
Back up important files before applying recursive permission changes. A wrong recursive command can break a website.
Structured Checklist Steps
- Find website root.
- Check owner and group.
- Check directory permissions.
- Check file permissions.
- Identify service user.
- Check uploads folder.
- Check cache folder.
- Avoid 777.
- Fix ownership carefully.
- Test frontend and admin.
Verification Steps
- Website loads.
- Uploads work.
- No 403 permission error appears.
- Files are not world-writable.
- Ownership matches the service model.
Rollback Plan
If permission changes break the site, restore the previous backup or apply known safe WordPress permissions to files and directories.
Common Mistakes
- Using chmod 777 to fix everything.
- Running recursive chown on the wrong path.
- Forgetting the PHP-FPM user.
- Confusing file permission with Nginx routing.
- Not checking uploads and cache separately.
Related Commands
ls -la /var/www/example.com
find /var/www/example.com -type d -exec chmod 755 {} ;
find /var/www/example.com -type f -exec chmod 644 {} ;
sudo chown -R www-data:www-data /var/www/example.com/wp-content/uploads