My magento2 back end URL is not working, I am not able to login into the back end. When I tried to open magento2 back end URL at that time it gives 403 error.This happened after I changed permission with

find . -type f -exec chmod 644 {} \; 
find . -type d -exec chmod 777 {} \;
chmod -R 777 pub 
chmod -R 777 var 

How can I resolve this?

  • what permission you have given? Commented Sep 20, 2016 at 12:19
  • give following permission: find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 777 {} \; chmod -R 777 pub chmod -R 777 var Commented Sep 20, 2016 at 12:28

2 Answers 2


Recommended is 644 for files and 755 for directories, or 664 for files and 775 for directories, if the cli user is not the same as the webserver user. If neither is enough, file ownership is not set up correctly. If the file system owner is not the same as the web server user, they should at least be in the same user group.

If you are on Magento 2.0.6 or higher, plase read the docs on file system ownership and permissions. There are complete instructions for both scenarios (two file system owners vs. one file system owner)


Please following below command step by step and it's working not any issues.

php bin/magento maintenance:enable
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento setup:static-content:deploy --theme Magento/backend -f
php bin/magento maintenance:disable
php bin/magento cache:flush
php bin/magento indexer:reindex

After all command run then run below permission command for required folder.

sudo chmod -R 777 var/ generated/ pub/media/ pub/static/

I hope it's help for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.