I was trying to install a patch through SSH and followed the directions to change folder permissions; it came up saying
operation not permitted
but now my site is down with a
403 – Forbidden Error
I am going through each folder manually trying to change the folder permissions back to 755
and the file permissions back to 644
but it's
- Taking forever
- More than possible that some will be missed.
Please help! How do I revert them all back?
Will typing this into my terminal help?
#!/bin/sh
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod 550 mage
I'm scared to touch SSH
again. Can someone help me get it back?
Best Answer
While these permissions will get your site to work
They are certainly not recommended for you to use such wide open permissions. Before you start changing permissions you should understand what you are changing and why. The above example gives a lot of privileges to all your files and folders.
You should experiment with your permissions and to keep them as restrictive as possible. For example, most of your files can run with 440 (You can test)
Note from Magento suggestions here http://devdocs.magento.com/guides/m1x/install/installer-privileges_after.html
You see that you regular files are not writable at all, only your media and var folders. If you are on a shared server you may have to change the second bit to something other than "0"
If the above example does not work then you can try:
It is important that you don't leave your site wide open to the world!