View Single Post
Old 04-29-2010, 05:11 PM  
quantum-x
Confirmed User
 
quantum-x's Avatar
 
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
Quote:
Originally Posted by camperjohn64 View Post
Maybe I should define the problem better:

Website A, has a settings file. I want to create a duplicate settings file, in another folder that User A can modify. That is all I need to do.

This settings file will be used by the website to know what database, what template to use, stuff like that, basic DEFINE's for the website. The website I am using to set the settings file may or may not be the one that uses the settings file.

- Apache is running as nobody.
- I want to use an interface to set up this new site
- Since Apache is nobody, I cannot create a new folder without logging into SSH as root manually and chmod'ing the base directory.
- Even when I do that, the settings file is created as nobody, and User A cannot modify it once it is created, since it is not usera:usera, it is nobody:nobody
- Therefore, I need to login to SSH, make the folder, touch the file, then chown the folder AND file...only then User A can modify the file. I need to do this for every settings file, and every new variation of the website I make. WTF?!

I don't care if Apache runs as root. For the 23 minutes it takes to set up the sites, a hacker is most welcome to come and do his worst. He has a 23 minute window - enjoy. I have to login as root anyway - so either I sudo with the root password or I SSH with the root password - it's not like it's insecure either way I need to know the root pass to accomplish the task.
If apache is running as nobody, then make a php script:

Code:
mkdir('path/to/dir');
It'll be made as nobdoy as well
quantum-x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote