try this: Just just replace the "USER" with your login name without the quots.Quotations this should solve all permission problems
cd /var/www sudo chown -R "USER":www-data . sudo chmod -R 750 . find . -type d -wholename "*/sites/*/files" -exec sudo chmod -R 770 {} \;cd /var/www
sudo chown -R "USER":www-data .
sudo chmod -R 750 .
find . -type d -wholename "*/sites/*/files" -exec sudo chmod -R 770 {} \;
sudo chmod g+s .
find . -type d -exec sudo chmod g+s {} \;
sudo chmod g+s .this will set all the permissions as suggested by drupal if the problem still persists then the problem isnt with permissions
find . -type d -exec sudo chmod g+s {} \;