THIS IS A BASH SCRIPT for ubuntu 16.04 to correct magento2 permissions in CLI.
- ubuntu root or SUDO user
- Magento 2.0.6 or higher
You need to change the following 3 things in correct_permissions.sh:
- Installation folder
- magento user name
- magento user group
*remember to use absolute path on linux
LIB="/var/www/magento2/"
sudo chown -R magento_user:magento_group $LIB
you are done ;)
sudo chmod +X "correct_permissions.sh"