AWS EC2 Ubuntu File permissions issue

Solution:

I solved this by doing the following:

  1. Set htdocs owner to bitnami:bitnami

sudo chown -R bitnami:bitnami htdocs/

  1. Inside /htdocs, changed file and directories owner to bitnami:daemon

sudo chown -R bitnami:daemon

  1. Changed files and directories permissions

sudo find * -type d -print0 | xargs -0 chmod 0755 # for directories

sudo find . -type f -print0 | xargs -0 chmod 0644 # for files

  1. Changed wp-content directories permissions to 775

sudo find wp-content/ -type d -exec chmod 0775 {} \;

And with that now I’m able to edit and upload via FTP and in the WP admin dashboard.