I have an issue while try to run commands bin/magento in terminal. Commands not working. No command run after bin directory. You can see the below screenshot about the error.

Basically yesterday I installed Mailchimp extension using SSH Putty (login as root user). Now I can't run commands in terminal.

enter image description here

Need help.

  • Try sudo magento c:f. Commented Jan 16, 2019 at 13:04
  • sudo magento cache:flush. not working, showing "sudo: effective uid is not 0, is /bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?" Commented Jan 16, 2019 at 13:14

4 Answers 4


You need to run magento2 ssh command from root of the magento. Goto directory public_html (not goto bin directory) and run

php -f bin/magento cache:flush

To reset all file and folder permission

find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento

Change permission of these three directory & files to 755 or 777.

chmod -R 777 var pub generated

Go to public_html/bin and change permission to 775

  • Tried. Still not working. Commented Jan 16, 2019 at 13:09

You have to run it inside the magento root project.

inside public_html not in public_html/bin/


Give permission to generated Directory

chmod 755 -R generated

GIve appropriate permission to generated directory.

  • 1
    Friends don't let friends 777.
    – kanenas
    Commented May 13, 2019 at 8:57

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.