Area Owner Permissions Why
Core WordPress files theekshana:www-data 755 folders, 644 files So you can edit, and NGINX can read
Uploads folder www-data:www-data 755 folders, 644 files So WordPress can write uploads
Other content folders Same as above 755/644 Depends on plugin/theme needs

Awesome, Theekshana! Since you’re the admin user with full privileges, and you're running a local WordPress project on VirtualBox Ubuntu Server, here’s a recommended strategy for setting ownership and permissions that balances:

Security

Ease of development

Proper WordPress functionality


🔐 🔧 Ownership & Permission Strategy (for you: theekshana)

🧾 1. Set Ownership: Your User + Web Group

Let you own the files but let the web server (NGINX) access them by setting the group to www-data.

sudo chown -R theekshana:www-data /var/www/mytestsite

This means:


🔒 2. Set Permissions for Folders and Files

# Folders: readable & accessible
sudo find /var/www/mytestsite -type d -exec chmod 755 {} \\;

# Files: readable
sudo find /var/www/mytestsite -type f -exec chmod 644 {} \\;

Why?