vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Forum and Server Management (https://vborg.vbsupport.ru/forumdisplay.php?f=232)
-   -   What should my folder permissions be set at? (https://vborg.vbsupport.ru/showthread.php?t=241049)

natecoupons 04-23-2010 02:43 AM

What should my folder permissions be set at?
 
I have noticed that some of my server folders permissions are set to 755, others are set to 747.

What is the danger in this, and are their exceptions? Should any folder ever be set to 777?

Angel-Wings 04-23-2010 07:25 AM

Generally it isn't a good idea to let the same user that runs PHP scripts write anywhere in the webroot so 755 / 777 isn't a good (and safe) idea.
If you still want to store attachments in the filesystem put this directory outside the webroot, chown it the user running PHP and set it to 700.
Maybe a simple example:

/home/www/site/webroot - that's the folder your Webserver is serving

If you run PHP as user "example" and Apache is running under "www" - both group and user - the "webroot" can be set to 550 if example owns it and www is the group.

/home/www/site/uploads - folder where attachments belong - this directory isn't served by your Webserver

Set to 700 if "example" owns this directory.

If you still need to let PHP put files inside the webroot so you've folder left where PHP can write files, you can prevent PHP from parsing scripts there - as example:

Quote:

<Directory "/home/www/site/webroot/signaturepics">
php_flag Engine Off
</Directory>
Or when running FastCGI removing the Handler.

That's all just in case character filtering isn't done correctly so someone could put an executeable PHP script in your webroot to - well - from dumping your DB to abuse your machine for attacking other sites.

Just a note: changing permission for directories to 550 and to 440 for files may also prevent FTP from storing or changing files so these permissions would need to set back before chaning files through FTP.

natecoupons 04-23-2010 07:03 PM

okay does vbulletin have standards of security for folders?

I'd just like a simple list that says:
admincp - 755
archive - 645
clientscript - 747

etc.

I don't want to change any of the permissions because I just know that it will affect something. I also don't want to leave the server open to attack or hacking.

Angel-Wings 04-23-2010 07:48 PM

Well - not using archive so unsure about it's permissions but every VB folder is set to 555 here except:

clientscript/vbulletin_css

That's set to 755. In this folder all files are set to 644, the rest of all VB files to 444

It may differ if you let users upload signature images and these are stored in the filesystem - then this folder requires write permission too.

And - some modifications may require write access somewhere :)

natecoupons 04-24-2010 06:21 PM

Hmmmm well this evening ill start changing my permissions. I need to really secure our server after an incident.


All times are GMT. The time now is 01:02 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01025 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete