Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Setting Up Your Zen Cart Products / Setting Up Categories, Products, Attributes / My host tells me that my images folder can't be left at 777

My host tells me that my images folder can't be left at 777

Locked

Started by angel17846 on 26 Aug 2009, 3:28 PM · Views: 1,930

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
26 Aug 2009, 3:28 PM
#1
angel17846 avatar

angel17846

New Zenner

Join Date:
Dec 2005
Posts:
57
Plugin Contributions:
0

Post #1 by angel17846

I have used Zen Cart for a while now, but find that if I leave the images folder permissions to 777, it is left vulnerable and open to security issues on my server.

My host says to change the image folder to 755, but then I am not able to upload images in the admin (I get error: Catalog images directory is not writeable: /home/username/domains/mydomain.com/public_html/images/)

My host says that a folder should never be left at 777.

What can I do?

Angel

27 Aug 2009, 12:07 AM
#2
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Post #2 by website_rob

Your Host is correct and has given you good advice.

When you are working in your Admin, adding new Products or making edits, you can have the 'images' dir. set to 777 permissions. But when you are finished, make sure to change them back to 755. Easiest way to do that is with your FTP program.

For added protection, copy & paste the following into an .htaccess file which is then placed in your 'images' dir.

This code is great for directories where "NO" script should be run from but for whatever reason,

you need Directory permissions to be 777 - which is wide-open and insecure by itself.

Examples Directories would include: any 'images' dir. and the 'bmz_cache' dir. if using ImageHandler 2

The following one line of code will prevent the ability of any scripts to run.

No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.

Will also prevent people from seeing what is in the dir. and any sub-directories

OPTIONS -Indexes -ExecCGI

The learning is in the doing.

Potent Products

27 Aug 2009, 3:02 PM
#3
angel17846 avatar

angel17846

New Zenner

Join Date:
Dec 2005
Posts:
57
Plugin Contributions:
0

Post #3 by angel17846

Great - I really appreciate it.

But what if other people are adding/changing products in the admin that don't have FTP access? That seems a little much to have to go through every time.

Just wondering how other people have handled this issue.

Angel

27 Aug 2009, 10:47 PM
#4
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Post #4 by website_rob

To get around having to change permissions back 'n forth but still keep things secure, ask your Host if they will do the following for your images dir.

change permissions to 775
change group ownership to nobody

The above cannot be done by yourself without Shell access which you probably don't have. If they will do it for you, you will not have to be changing permissions all the time as the permissions will stay at 775.

The learning is in the doing.

Potent Products

29 Aug 2009, 7:25 PM
#5
fony avatar

fony

New Zenner

Join Date:
Sep 2008
Posts:
9
Plugin Contributions:
0

Post #5 by fony

Hi Rob,
I have the same problem,
I run two websites, one locate on Bluehost,
other website is running on VPS ,
I check the permission of both images files,
it is same, 755
but work on bluehost,
and get error on VPS, said not writeable.:(
any advice?
tks a lot....

spam removed

29 Aug 2009, 11:32 PM
#6
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Post #6 by website_rob

Not enough information to give a good answer.

An educated guess on your VPS setup tells me your 'image' dir. permissions should be 777 to work from within Zen Cart Admin. If that is true you should follow the same information I gave in post #2 and #4.

The learning is in the doing.

Potent Products

14 Jul 2010, 3:10 PM
#7
huntmine avatar

huntmine

New Zenner

Join Date:
Jul 2010
Posts:
2
Plugin Contributions:
0

Post #7 by huntmine

Hi Rob, I had that problem too.
I just emailed the host company,and then they helped fix it.haha:smile:

20 Jul 2010, 10:29 PM
#8
ztotheetothen avatar

ztotheetothen

Zen Follower

Join Date:
Oct 2006
Location:
Los Angeles
Posts:
111
Plugin Contributions:
0

Post #8 by ztotheetothen

Website Rob:

OPTIONS -Indexes -ExecCGI

I'm trying to secure my site, where do i add the quoted text?
I've mad a huge mistake by leaving my /images folder unsecure, and i had scripts that were running there, placed by hackers.

22 Jul 2010, 2:07 AM
#9
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Post #9 by website_rob

Protect Your Images Directory

this code should be placed here: images/.htaccess

This code is great for directories where "NO" script should be run from... but for whatever reason,

you need Directory permissions to be 777 - which is wide-open and insecure.

Examples Directories would include: any 'images' dir. and the 'bmz_cache' dir. if using ImageHandler 2

The following one line of code will prevent the following:

- people from seeing what is in the dir. and any sub-directories within it

- ability of any scripts to run, be it PHP, PERL or whatever, cannot normally be executed if ExecCGI is disabled.

OPTIONS -Indexes -ExecCGI

Here is additional protection, a one-liner that works regardless if PHP is Apache or CGI

and will protect all sub-directories within your 'images' directory as well.

RedirectMatch ^/(.*.php)$ /404.shtml

Note: make sure you have created a 404.shtml page. 'http://yoursite.com/404.shtml'

end protection

The learning is in the doing.

Potent Products