Jump to content

public_html : chmod 750 or 755 ?


Recommended Posts

Posted

Hello ! :)

I could no longer access my public_html directory with my FTP clients. I believe it was a problem of owner : for the public_html directory, the owner was root and for the other directories, the owner was my account's login name (for instance "myforums").

The technician did this through SSH :
chmod 755 -R myforums

When I noticed it was chmod 755 I tried to chmod it to 750 but nobody could no longer access my board and got this message :

You don't have permission to access /index.php on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

So I had to chmod it back to 755. Is this a problem (especially regarding security) ?

Thank you ! :)

chown myforums.myforums-R myforums


Forbidden



Posted

There is no reason that you should not set up public_html as 750. Its the folders and the files underneath public_html where you need the last number to be at least '4'.

Posted

[quote name='rct2·com' date='15 October 2009 - 10:54 AM' timestamp='1255618440' post='1866915']
There is no reason that you should not set up public_html as 750.
If I do this, I get a white page with the Forbidden access error message...

I've had a look at the directories and files in my new server's public_html directory and they are all chmoded 755. On my old server, the directories are 755 (a few are 777) and the files (php files) are 644...

Posted

Here is what the technician typed exactly through SSH (yforums being the directories owner and group) :

cd /home/yforums/
ls -l
cd www
ls -l
cd ../../
chown yforums.yforums-R yforums
chmod 755 -R yforums

Posted

By using this command he chmoded all the directories to 755... Now I have to chmod my uploads directory and it's content back to 777... Some other directories too... I don't understand how such mistakes can be made by tehcnicians who pretend to be server experts... Perhaps should I have mentionned that some directories shouldn't be chmoded to 755, but I didn't know he would do that.

Do you know which command I can run through SSH ? (I read this : http://en.wikipedia.org/wiki/Chmod but it's not clear to me).

Will this one do ? chmod 777 -R yforums

Thank you ! :)

Posted

So the first 5 commands move him to the /home folder

And the next one RECURSIVELY changes the ownership of everything from /home/yforums downwards to owner yforums, group yforums
Then the next one RECURSIVELY changes permissions to 755 from /home/yforums downwards

If public_html needs to be 755 in a WHM/CPanel environment, then I guess it does. In my PLESK environment httpdocs is 750 and it works fine.

Posted

[quote name='SecondSight' date='15 October 2009 - 05:12 PM' timestamp='1255623178' post='1866969']

Will this one do ? chmod 777 -R yforums


From your /home folder it will CHMOD EVERYTHING under /home/yforums to 777. Not a great idea if you're worrying about security, which is where this topic began.

Posted

No :) , I only want to chmod 777 the upload directory, subdirectories, and documents because I have tens of thousands of files in these directories...
Moreover, my board's members can no longer upload files... The error message is :

Upload failed. Please ask the administrator to check the settings and permissions

Posted

OK well now the server admin has set it up so you can FTP onto the site, it's probably easiest to use the FTP client to change permissions, rather than having to learn Linux command line. :)

Posted

I need to learn too and I like learning. :)

In fact, as for the uploads directory, it contains a lot of files (thousands) and I use WinSCP to chmod the files (and not a FTP client because it won't see all the files).

I used the FTP client to set the permissions as they were before in all directories (etc, mail,public_ftp, and so on) as wel as in the public_html directory .

All folders are chmoded 755 and the files inside them are chmoded 644, except :
- style_images,
- style_emoticons,
- style_avatars,
- style_captcha,
- cache
which are chmoded 777 and contain files which are also chmoded 777. Is it normal that .htaccess files are chmoded 777 too ?

Posted

I tried chmoding the uploads directory 777 using WinSCP and 5 hours later it was not finished and it seemed like it would not... :(

So, I used SSH. I made a few tests first and then it took only a few seconds to solve all these permission problems : chmod 777 -R uploads. :)
Now I can upload files again on my board. :)

Thank you very much rct2.com ! Your explanations did help me a lot. :)

I still have this error message when I try chmoding the public_html directory to 750 :

You don't have permission to access /index.php on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

I didn't have this message before... Does someone know why ? Did it work before because the owner to the public_html directory was root (then it was changed to my account's name and I got the error) ?

Thank you ! :)

Forbidden



Posted

ok ! I fixed it... Here is what I did :

Two directories didn't have the correct chown, so I did this :
chown myforums.nobody .htpasswds
chown myforums.mail etc

I did the same for the public_html directory and there is no more problems in 750 mode :
chown myforums.nobody public_html

Do you think this is ok regarding security ?

Thank you ! :)

Posted

[quote name='SecondSight' date='15 October 2009 - 03:40 PM' timestamp='1255617607' post='1866912']
Hello ! :)

I could no longer access my public_html directory with my FTP clients. I believe it was a problem of owner : for the public_html directory, the owner was root and for the other directories, the owner was my account's login name (for instance "myforums").

The technician did this through SSH :


When I noticed it was chmod 755 I tried to chmod it to 750 but nobody could no longer access my board and got this message :



So I had to chmod it back to 755. Is this a problem (especially regarding security) ?

Thank you ! :)


The three digits in chmod refer to the USER GROUP AND OTHER permissions respectively. Depending on which process is running your webserver, you will find either 755 or 750 work. If the webserver is in the group that owns the public_html directory then 750 will work (since 5 is referring to the group having read and execute permissions). Otherwise you will need 755, so that others (including the webserver) can access it.

Hope that helps you all.

  • 5 months later...
Posted

[quote name='bgk' date='23 October 2009 - 10:00 PM' timestamp='1256306443' post='1870496']
The three digits in chmod refer to the USER GROUP AND OTHER permissions respectively. Depending on which process is running your webserver, you will find either 755 or 750 work. If the webserver is in the group that owns the public_html directory then 750 will work (since 5 is referring to the group having read and execute permissions). Otherwise you will need 755, so that others (including the webserver) can access it.

Hope that helps you all.



I had a functioning board. Then I downloaded a converted. Uploaded the files. Transmit on Mac OSX. Now the forum won't work at all! I see this message:

Warning: require_once(/home/domain/public_html/forum/admin/sources/base/ipsRegistry.php) [function.require-once]: failed to open stream: No such file or directory in /home/domain/public_html/forum/index.php on line 21

Why is this? I have "chmod -R 755 admin" in my forum directory. But it still doesn't work. Should I try 750?



  • 3 weeks later...
Posted

No such file or directory suggests the file isn't there. You'd get permission denied or something else if it were a permission problem. I suggest checking that ipsRegistry.php is on the server in that path ...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...