LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > PHP & Security nightmare.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-09-2008, 11:40 PM
Alex Bolton Alex Bolton is offline
New Member
 
Join Date: Nov 2008
Posts: 5
Default PHP & Security nightmare.

I'm a dreamhost PS virtual private server user. Dreamhost PS is very generous in all aspects, apart from the fact that I don't get root (ick!). This is not actually so bad with my current configuration, except for one major flaw - for PHP to write to files I need group write permission set on that file, which of course is a horrible security concern.

At the moment my litespeed installation runs as a dedicated user "lenore_lsws" with the group "pg1184884". All my other users are also in the group "pg1184884".

Is there a better way to do this that does not involve using a privileged user (or moving to a new virtual dedicated provider, although I sadly might have to end up doing this)?
Reply With Quote
  #2  
Old 11-10-2008, 01:37 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Have you tried PHP suEXEC?

Or, if "Role based security" like selinux is available, you can let them to give write permission to all those file for user "lenore_lsws".
Reply With Quote
  #3  
Old 11-10-2008, 02:10 PM
Alex Bolton Alex Bolton is offline
New Member
 
Join Date: Nov 2008
Posts: 5
I believe suexec would not work as the litespeed user would have to be a super user.

My current idea for a work around is to create a secondary user group that both lenore_lsws and the users I want to have write permissions share, and then use a combination of setting write permissions for the new group and using umask (thanks to a dreamhost staff member for the suggestion) to help ensure that permissions are correct in the future. It's not the most elegant of solutions but it should work fine.
Reply With Quote
  #4  
Old 11-11-2008, 09:13 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Yeah, that's true. suEXEC need root.

suEXEC is the best solution, maybe let dreamhost admin install web server as root, give you a sudo permission to start the web server as root.
Reply With Quote
  #5  
Old 11-11-2008, 09:21 AM
Alex Bolton Alex Bolton is offline
New Member
 
Join Date: Nov 2008
Posts: 5
Quote:
Originally Posted by mistwang View Post
suEXEC is the best solution, maybe let dreamhost admin install web server as root, give you a sudo permission to start the web server as root.
I'll ask them, I don't think they will do that for me - but it can't hurt to ask. Thank you for your help mistwang
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:13 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.