Joomla! Discussion Forums



It is currently Sun Nov 08, 2009 3:42 am (All times are UTC )

 


Forum rules

Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Security Checklist
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 12 posts ] 
Author Message
Posted: Thu Oct 06, 2005 9:02 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Sep 13, 2005 1:05 am
Posts: 41
Greetings All,
I have been installing and working Joomla for a few weeks and one thign that is still unlcear to me is the CHMOD settings for the directories and files??

1. What is the reall, actual, sure-fire, settings all the directories and files?
2. What should the configuration.php file be set to?
    If it is 777 to edit why on earth is this the case? Why should it ever need to be 777?
3. Does apache have to be added to the group owner of the folders? My install seems like folders are not writable unles sthey are 777 .. please help??

Please provide as much detail as possible and point me anyplace in the documentation that this information may already exist because I cant find it in a clear way????

Please know I may sound a little frustrated because I have been looking for a definitive answer all day but.... I love Joomla and you all rock!

Warm regards,
Jeffrey

_________________
Lead Developer - iVisage Development | http://www.ivisage.com
"I have made this letter longer than usual, because I lack the time to make it short.” – Blaise Pascal


Last edited by ivisage on Thu Oct 06, 2005 10:12 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Thu Oct 06, 2005 10:34 pm 
User avatar
Joomla! Hero
Joomla! Hero
Offline

Joined: Thu Aug 18, 2005 2:09 am
Posts: 2803
Location: California
The only place this is mentioned in the documentation is here in the Manual Installation instructions.
http://help.joomla.org/content/view/40/132/
About half way down the page.
That appears to be out of date.

The current Joomla installation defaults are:
- Files: 0644
- Directories: 0755
This is from looking in the code.
I have not found any other documentation discussion.
There was a post from one of the devs back in the old forum discussing this issue,
but I have not been able to find it again.

Manually editing configuration.php:
Usually I set configuration.php to 0777 to edit,
and then back to 0644 to lock it for normal operations.

If you make changes from the Joomla back-end, it is all done for you.

_________________
██


Top
   
 
Posted: Wed Oct 19, 2005 12:36 am 
Joomla! Fledgling
Joomla! Fledgling
Offline

Joined: Mon Oct 03, 2005 7:59 pm
Posts: 2
Newbie here... plus I'm a Microsoft captive so please be gentle 8-)

I understand that I need to make configuration.php writeable so I can do some Global Configuration stuff, and I understand about file permissions. But I don't know how to actually do it.

1. How/where do I set configuration.php to 0777? Do I do that from some tab in Joomla?

2. Kenmcd says "If you make changes from the Joomla back-end, it is all done for you." That sounds really good... but how/where do I make changes from the Joomla back-end?

Thanks! - Mike


Top
   
 
Posted: Wed Oct 19, 2005 5:18 am 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 5744
Location: New York
Do you have mambEoxplorer installed? You can do it through that.

_________________
Read your words before posting and think about how other people will read them.
Be polite. Be kind. Be constructive. Say thank you.
Freedom-Equality-Trust-Community-Collaboration-Usability
http://opensourcematters.org/index.php?Itemid=134


Top
   
 
Posted: Sun Oct 23, 2005 6:44 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Fri Sep 09, 2005 5:33 am
Posts: 19
FTP is much quicker for multiple changes, but using mamboxplorer means you can do it without leaving your browser. In Joomla, when you edit your "global" configuration settings, the permissions are temporarily modified to enable saving, and then they are immediately reset to 644 for files and 755 for directories (or something like that). Always make sure that these are appropriate settings for the files/directories in question however!

But security goes beyond basic permission setting. It also involves an awareness of to what degree important files are available for the public viewing.

If you have performed a migration by dropping files over the top of an existing mambo installation, you might find that http://www.mysite.com/configuration.php-dist page can be viewed, and has execution priveleges.

This is no big deal but it helps illustrate how a file and its settings can be overlooked, and if you used it as a backup to your existing configuration.php (on your local machine for instance) or haven't changed the $mosConfig_secret in your global configuration, this info is now fairly easy to obtain.

It isn't necessary provided once you have done your migration so just take it off your online server if you haven't already done so.

Some components allow you make their config files "unwriteable" (e.g. template manager, and other addons) which is great, and if you have finished with a particular item, then i would definately recommend doing that. 

This being said, if you need to edit an "unwriteable" file, you may need to use ftp or mamboXplorer to change change the settings back to writeable, but for most maintenance requirements joomla manages the setting of permissions of files and directories very well in of and by itself.

Hope this basic discussion helps make things a little clearer... ?


Last edited by audiofile on Sun Oct 23, 2005 7:25 pm, edited 1 time in total.

Top
  E-mail  
 
Posted: Mon Oct 24, 2005 6:29 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Fri Aug 26, 2005 5:05 am
Posts: 291
Location: Pennsylvania, USA
I'd really like to see this subject addressed by the core dev group since there doesn't seem to be a definitive 'official' answer.

For example, while setting up a project for a school district in a testbed at my company's own host, 1and1.com,  the 'suggested' settings of 755 on dirs and 644 for files worked fine and dandy, as they should.  However when I then moved the site to another hosting provider, totalchoicehosting.com, I have found that much to my dismay that many core functions of the Joomla won't work AT ALL unless certain directories were set to 777 - permanently - not just when installing a com/mod/bot.

As you can imagine, I'm quite uncomfortable allowing such permissions and I'm at a loss for why the move necessitated setting them.  I know that 1and1.com runs PHP as CGI (I'm assuming through an Apache handler, though I'm still learning how all THAT works); could this be a possible explanation?

I really need someone to explain to me why this is, and what I may be able to do with my host (who seems pretty knowledgeable and cooperative) to get things back to a more secure footing?  And can we have, once and for all, a DEFNITIVE guide of the Joomla directory in tree form with the NECESSARY permissions notated?  Core Devs, please weigh in!!

I know I speak for many when I say that answers to this question would be very helpful indeed and should be part of the FAQ.  In helping one user in these forums, I was given access via FTP and was flabbergasted to see that ALL their dirs were marked 777!  But the user insisted that this was the only way she could get Joomla to function.  I'm afraid that if we don't address this there will be a lot of busy script kiddies out there in the near future....

Thanks for your indulgence  ;)

_________________
Robert Anthony Pitera
West of East, Inc. - http://www.westofeast.com - Taking technology in new directions™
SchoolastechWorks - http://www.schoolastech.com - Joomla Educational Development


Top
   
 
Posted: Mon Oct 24, 2005 6:46 pm 
User avatar
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Fri Aug 26, 2005 5:05 am
Posts: 291
Location: Pennsylvania, USA
Well after a bit of research, I have come up with an explanation as to why the issue I brought up is happening; on TCH (and I suspect many other ISPs) PHP scripts run as user 'nobody'.  Here's a post on the subject from TCH's forums:

Quote:
As Mambo is a PHP script, it runs as the user 'nobody'.  In order for it to create and delete files in a directory (one that you own), the directory permissions must be set to 0777, and file permissions on a file that you own must be 0666 in order to modify the file.  0775 directory permissions and 0644 file permissions would not be sufficient to allow Mambo to create/modify/delete files.

Running PHP scripts under your user ID requires configuring the web server to use phpsuexec to run them. From what I understand, phpsuexec is not used on TCH servers as some features of PHP don't work with phpsuexec enabled, and it can also result in breaking a number of PHP scripts. 

While this does weaken security to an extent, it involves only users with an account on the same server as you (other TCH customers on your server).  I don't believe there is any significant risk from the other customers on your server. The main threat is from hackers exploting a vulnerable script in another user's account, then being able to access your files and directories that have 0666/0777 permissions.

Your main defenses here are 1) only set 0777 directory / 0666 file permissions on directories and files that require it, and 2) make and keep regular backups of your account, so if your files are tampered with, they can be easily restored.


Any comments from the core devs?

_________________
Robert Anthony Pitera
West of East, Inc. - http://www.westofeast.com - Taking technology in new directions™
SchoolastechWorks - http://www.schoolastech.com - Joomla Educational Development


Top
   
 
Posted: Mon Oct 24, 2005 7:08 pm 
User avatar
Joomla! Master
Joomla! Master
Offline

Joined: Thu Aug 18, 2005 7:13 am
Posts: 13187
I have everything at 755/644. Only when I install/uninstall components, or change configuration.php, I change it to 777 for just this purpose. If I can only run Joomla at 777, it would be time to find a new hoster who does have a decent configuration.

_________________
Antonie de Wilde - Forum admin
All Joomla! release dates and days between releases: http://jfoobar.org/blog/189-days-betwee ... a-releases.test


Top
   
 
Posted: Tue Oct 25, 2005 5:33 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Wed Aug 17, 2005 11:46 pm
Posts: 837
Hosts that use phpSuExec (or similar) will allow Joomla/Mambo to write to any files/folders with chmod settings at 0644/0755. If you are not using it they will need to be tweaked to be more open.

_________________
Doyle Lewis
BuyHTTP Internet Services
http://www.buyhttp.com/joomla_hosting.html - No Overselling Guarantee. Your Joomla site, faster.
http://www.joomlademo.com - Joomla flash tutorials.


Top
   
 
Posted: Wed Nov 02, 2005 5:51 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Oct 11, 2005 5:36 am
Posts: 20
I'm using 775 for directories and 644 for files but don't really know how should they be set.
My account is userA and apache is runned by userB and userB is in group userA. So when my user is the owner of the joomla files should the file permissions be set to 664 so that joomla will have permission to write files? Is this so hard or am I so d*mn slow that I don't get this? :)


Top
   
 
Posted: Thu Nov 10, 2005 8:28 pm 
Joomla! Explorer
Joomla! Explorer
Offline

Joined: Sat Nov 05, 2005 7:43 pm
Posts: 279
SMF must not have a good searching mechanism because it completely missed this thread when I searched for "permissions."

I am having a weird permissions problem and am unable to fix them. It seems to be a Joomla related problem but I can't be sure at this time. For the most part, I always change my files to 666 for internal writing purposes because 777 invites trouble. Joomla performs fine but for a strange reason I cannot access files to manipulate unless I am SU and even then I have problems. perhaps based upon your explanations files are in use. I would now know why your server would require 777 for Joomla to run although that is the only setting for which I can move a number of files between directories or even delete them. As others do not seem to have this problem, I'm wonder whether this is all host related although I have my own dedicated server.

_________________
http://www.thelaw.com - Free Legal Advice Resource
http://www.jnation.com - Free Jewish Dating & Social Networking


Top
  E-mail  
 
Posted: Fri Jun 23, 2006 4:27 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast
Offline

Joined: Tue Aug 23, 2005 9:54 am
Posts: 219
Location: Oslo
Hello, my understanding is that PhpSuExec is being installed on more and more shared hosting environments these days. My host just did this update, and now I am eager to see if I can run Joomla! with even stricter file and folder permissions.

Can someone please tell me what the lowest file and directory chmod I can use with Joomla!? All files owned by my (ftp)user.

I see I can run 755/644 while developing a site, but when everything is installed, could the directories be secured even more? I'm happy to run such a low setting that I'll need to chmod before installing stuff.

_________________
Did you know there's a Joomla irc channel? Chat to Joomla people live 24/7 - Join #joomla on the Freenode network ( irc.freenode.net )


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group