File Permission set to 777

March 18, 2014 5.5k views
Hi All, I install a tracking script on a folder and everything working fine, until I create a tracking link. It says "can't open file". I submitted a support ticket and they suggest to change the file permission of the folder (where script installed) to 755 or 777. I try with 755 but it didn't work, only 777 make it works. My concern is off course the security. They suggest me to call the hosting :( I'm running Ubuntu 12.04 x32 on my droplet. Anyone can shed the light on this? Thanks tony
7 Answers
Have you tried changing the ownership of the folder??

chown user:group folder_name

and then just set it to 755

chmod 755 folder_name

see if that works
Thanks disturbedrod,

I did change to 755 but the script insist to have 777.

The developer recommend to install suPHP. Then set the folder to 755.

I try searching here of any tutorial but not available.

I'm concern if I install suPHP on running server, it will create havoc on my sites on it.

Could you help shed the light on suPHP or point me to the right tutorial?

I try this:

Create new user:
sudo adduser admin_script_login root

Change ownership:
chown chmod 755 script_folder:root script_folder

Change permission:
chmod 755 script_folder

But the script still can't open file inside the folder.

Change permission again to 777, then the script working perfectly.

Now my questions is, with this folder configuration (Owner: script_folder and group: root), is it safe to set 777 on this folder?

Many thanks
Sorry mistype on ownership:

Change ownership:
chown script_folder:root script_folder
Maybe you can try changing ownership of your files to www-data:www-data?
Thank you very much Emilio,

It works!
So I don't have to install suPHP on my server.

Btw, I try to googling "introductory lesson" about www-data but can't find any. Could you please write a bit on this? So I know what I'm doing when installing any script with file permission like this again.

by Justin Ellingwood
In this article, we will discuss how to read and manipulate Linux permissions. We will cover how to use the "umask" command to choose default permission settings, and the "chmod" command, which can change the permissions of files and directories.
Have another answer? Share your knowledge.