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'm running a web server, and I want to give some people FTP access to their own folders. I don't want these people to upload PHP scripts that are able to do anything they want with the server, but some are interested in running PHP scripts such as forums. Is there a way that I can restrict all PHP scripts in a certain folder to only have access to files and subdirectories in that folder?

share|improve this question

migrated from stackoverflow.com Aug 25 '11 at 1:47

This question came from our site for professional and enthusiast programmers.

2 Answers 2

What you are asking for is known as a chroot jail, wherein from each user's perspective, his is the root directory of the server, and therefore cannot navigate upward to the the parent directory holding other users' directories. How you implement it depends on your FTP server, but most have a configuration option to enable it.

share|improve this answer

Michael's suggestion for using a chroot jail will do the job but is generally overkill for most web scenarios unless you are very paranoid.

Instead why not use something like suPHP where php runs as each different user/site. Then if file permissions are set correctly you will not be able to access areas which could cause damage to other server users. suphp is commonly used by some shared hosting providers.

share|improve this answer

Your Answer

 
discard

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