For security reasons, Magento says to change the file and folder permissions after install.
Can this be done from the backend via:
System -> Magento Connect -> Magento Connect Manager -> Settings -> Use Custom Permissions?
What are the safest settings in that panel for Folders and Files?
You should set file permissions using SSH commands.
Refer this official documentation for the file permissions. After You Install Magento: Recommended File System Ownership and Privileges
Please see the following section of the above documentation :
Securing Magento Extensions
If you set permissions and ownership as discussed in this article, you must change permissions temporarily to be able to use the Magento Connect Manager in the Admin Panel.
(System > Magento Connect > Magento Connect Manager). You can still install extensions manually, however; that is beyond the scope of this article.
You can confirm the issue when you access Magento Connect Manager in the Admin Panel. The following error displays on the Extensions tab page:
Warning: Your Magento folder does not have sufficient write permissions.
To use Magento Connect Manager, you must:
1) Temporarily set 700/600 permissions on your Magento installation directory and subdirectories.
2) Install the extension.
Magento Connect Manager typically installs extensions with 777 (world-writable) permissions.
3) Set permissions back to their recommended values.
In addition, if you have a dedicated Magento server, you should check ownership of files and directories and reset them if necessary.
Often, Magento Connect Manager installs extensions with user and group ownership both set to the web server user.
If you face file permission issue during installation of extension using Magento connect. See the point 2 Magento Connect Manager typically installs extensions with 777 (world-writable) permissions.
So the settings in admin allow you to change file permissions to install extension using Magento connect.
NOTE: After installing the extension revert back the files permissions to recommend ones.
Best way to give a folders and files permission is:
sudo find /var/www/wordpress/ -type d -exec chmod 755 {} \;
sudo find /var/www/wordpress/ -type f -exec chmod 644 {} \;
And then give permission 0777 to folders Media, Var, app/etc.
sudo chmod -R 0777 var/
sudo chmod -R 0777 media/
sudo chmod -R 0777 app/etc/