Make sure you run the following commands from inside Drupal's root directory! 

If you run these commands from any other directory, you either will not make changes to all of the Drupal installation's files and directories or you will make changes to files and directories other than those in the Drupal installation. 

Neither alternative is your goal.


cd /path_to_drupal_installation
sudo chown -R michel:www-data .
sudo find . -type d -exec chmod u=rwx,g=rx,o= '{}' \;
sudo find . -type f -exec chmod u=rw,g=r,o= '{}' \;
sudo chmod -R 777 sites/default/files