Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a few important documents that I keep owned by www-data (apache's user) in my /var/www/ folder. They have to be www-data because PHP will write to them at times.

I also have users who access the system in /home/ ... They have access to make websites but are FTP rooted to their home directory, however.

I think it would be possible to simple make a PHP file that lets them read most of my /var/www/ PHP files, and not to mention write/delete my www-data owned files.

How can I get PHP and every other command to jailed to the users home directory?

share|improve this question
1  
See this question. Basically with something like suphp or the alternatives you can have PHP run as a the specific user. –  Zoredache Aug 17 '10 at 23:37
    
Also search do a search here for suphp there are lots of related question that include details about setting things up. –  Zoredache Aug 17 '10 at 23:45

2 Answers 2

In addition to the suggestion of suphp, you might also consider looking at the open_basedir options... http://www.php.net/manual/en/ini.core.php#ini.open-basedir

share|improve this answer

You may try CloudLinux kernel ;) it has this built in called SecureLVE

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.