Linux File System and Permission Model Checklist

halfbrain_logo512adminJune 15, 2026
5 lượt xem

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

  1. Identify the website root path.
  2. Check file owner and group.
  3. Check directory permissions.
  4. Check file permissions.
  5. Identify which user runs Nginx or PHP-FPM.
  6. Confirm WordPress can write only where needed.
  7. Avoid 777 permissions.
  8. Check uploads, cache and backup folders.
  9. Fix ownership carefully.
  10. 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.

Checklist Type Security
Level Beginner
Risk Level High Risk
Estimated Time 30–60 minutes

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

  1. Find website root.
  2. Check owner and group.
  3. Check directory permissions.
  4. Check file permissions.
  5. Identify service user.
  6. Check uploads folder.
  7. Check cache folder.
  8. Avoid 777.
  9. Fix ownership carefully.
  10. Test frontend and admin.

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

Share:

Disclaimer: The guides, checklists, commands, and examples on HalfBrain.net are provided for educational and operational reference only. Server environments, hosting providers, software versions, security settings, and WordPress configurations can vary, so you should always review commands before running them on your own system. We do our best to keep the content accurate and useful, but we cannot guarantee that every command, configuration, or recommendation will fit every environment. Always back up your website, database, and server configuration before making changes. HalfBrain.net is not responsible for data loss, downtime, security incidents, misconfiguration, or other issues that may result from applying the information on this website. Use the material at your own discretion.

Leave a Reply

Your email address will not be published. Required fields are marked *