Jump to content

Is setting CHMOD to 777 Dangerous?


Recommended Posts

I'm trying to install Prestashop and spoke with the technical support representative from BlueHost regarding questions I had on setting the file permissions to 777 as stated in the following installation instructions:


While you have your FTP connected to your Web hosting server, make sure the following PrestaShop folders have ‘write’ permissions (also known as “CHMOD 777” – explanation of file permissions here) but do not apply these permissions recursively (to their subfolders): /config, /upload, /download, /tools/smarty/compile. Then make sure the following folders have ‘write’ permissions and apply these permissions recursively (to their subfolders): /img, /mails, /modules, /themes/prestashop/lang, /translations


They were very concerned that anyone could harm my website because I was providing full privileges to any user who happened to be on my website. The tech support rep gave me the analogy of leaving the keys in my car with the doors unlocked on a busy street in a bad part of town. In other words. someone will take advantage of this unrestricted permission setting.

Can you help me understand why I need to have permissions set to 777? Will 755 work? What risks are there by setting those particular folders to 777? Thanks in advance.
Link to comment
Share on other sites

Yes, it is dangerous to set chmod 777 permissions. You should only use chmod 755 for directories and chmod 644 for files. You should only use chmod 777 on older servers where chmod 755 causes write problems, though it would be better to go to a different host that does work with chmod 755 in that situation.

Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...
  • 3 years later...

Yes, it is dangerous to set chmod 777 permissions. You should only use chmod 755 for directories and chmod 644 for files. You should only use chmod 777 on older servers where chmod 755 causes write problems, though it would be better to go to a different host that does work with chmod 755 in that situation.

i just move my shop to other host , at first i had many error and after i turn on debug i see all my problem come form permission of file and folder , in new host i have to set all cash file permission as 777 otherwise i will get error and withe page . same files in my old host set as 644 and the site working well .

 

Can u tell me what shall i do that in new server i can to set files permission on 644 without any error ? 

Link to comment
Share on other sites

Correct settings for PS 1.5 x.:

 

The following folder should have write permissions (CHMOD 0750 or 0755): Some hosters do not support 0755 and allow only 0750

/cache
/cache/cachefs
/cache/smarty
/cache/smarty/cache
/cache/smarty/compile
/cache/tcpdf
/classes
/config
/config/xml/
/controllers
/css
/docs
/download
/img
/js
/localization
/log
/mails
/modules
/override
/pdf
/themes/default/cache
/themes/default/lang
/themes/mein Thema/cache
/themes/mein Thema/lang
/translations
/upload
/webservices

All other files  should have write permissions CHMOD 0640 or 0644  (exception for .htaccess, robots.txt and sitemap.xml - CHMOD 0664)

  • Like 2
Link to comment
Share on other sites

Correct settings for PS 1.5 x.:

 

The following folder should have write permissions (CHMOD 0750 or 0755): Some hosters do not support 0755 and allow only 0750

 

/cache

/cache/cachefs

/cache/smarty

/cache/smarty/cache

/cache/smarty/compile

/cache/tcpdf

/classes

/config

/config/xml/

/controllers

/css

/docs

/download

/img

/js

/localization

/log

/mails

/modules

/override

/pdf

/themes/default/cache

/themes/default/lang

/themes/mein Thema/cache

/themes/mein Thema/lang

/translations

/upload

/webservices

 

All other files  should have write permissions CHMOD 0640 or 0644  (exception for .htaccess, robots.txt and sitemap.xml - CHMOD 0664)

Thank you , i will go to check how it will works 

Link to comment
Share on other sites

when started to change permission site explode , so i copy all files again , to new host .

 

Friendly URL : OFF

Debug : ON

 

then i went to Regenerate thumbnails

 

i got this error 

Cannot write "No picture" image to (categories) images folder. Please check the folder's writing permissions.

i changed this folder permission to 0750 , 0755 , but still got same error

 

/img

/img/c

/img/tmp

 

i dont know why my host like that , is it possible becuz of apache server ?

apache server is 2.2.16

Link to comment
Share on other sites

The error states that there are no pictures available on folder. Please check. Perhaps your provider does not support chmod 0750(5) too. Please ask him. In this case you should set 0777, but as stated before there is a safety risk. You should search for a better provider in this case... ;)

Link to comment
Share on other sites

The error states that there are no pictures available on folder. Please check. Perhaps your provider does not support chmod 0750(5) too. Please ask him. In this case you should set 0777, but as stated before there is a safety risk. You should search for a better provider in this case... ;)

im running site on my own server , i have 3 physical firewall front of it , also install lastest ver of , PHP , Apache , mysql and etc. and everything working well . 

 

on this server was ran a shop before (but wasn't prestashop) , since i decided to shif to prestashop . 

can you tell me how can i set chmod for my server ? i have linux debian 

Link to comment
Share on other sites

CHMOD for files you set on FTP with Filezilla for example.Right mouse click on folder or file and change CHMOD.

i didnt install FTP on my server , only SSH access and winSCP , with winSCP o can to change permission .  

the problem is only if i make them as 0777 site working , all folder and file above should be 0777 . i dont know CHMOD is a module of apache?

Link to comment
Share on other sites

If your server requires 777 chmod check if you have the option to run php as fastcgi.

If you change the php settings to fastcgi permission problems will be gone in most cases and no need to use unsecure 777 settings.

Some hosters have fastcgi as option in their settings others give this option through .htaccess entry.

Edited by prestamax (see edit history)
Link to comment
Share on other sites

You are running an Apache or an IIS ? For Win-Servers you cannot set file permissions. Right permissions are set only on an upper instance and they are not flexible.

 

With winscp you access your FTP and can also set permissions (CHMOD) by folder and/or files, but only on Linux-Servers. Winspc is the same as filezilla, it is a FTP Client tool and works for Windows-Server and also for Linux. If you are running Windows-Server than you have to convert your .htaccess to a web.config. IIS has integrated a tool for this. Check on your panel.

 

By the way, after one year problems running prestashop on a windows-server I get back to linux. Although Prestashop also runs on Windows there are several problems with rewriting and permissions (and this each time you install a new module or feature). As from my experience I don't think that Windows-Server are ideal partners for to host Prestashop. ;)

Edited by selectshop.at (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...