Security tips for shared enviroment?

Let's for a moment say a server is totally setup correctly. What does it look like?

For example, what file system security method would prevent a user from writeing the following script:

Code:
<?php
echo "<pre>";
passthru("cat /directory/to/some/file/with/db/connection/string.php");
?>
What would prevent a user from writeing a script like that, and seeing the username and pass that a "neighbor" uses to connect to their database with? That's just one of many things that you could do... what is put in place on a server that is correctly setup to prevent things like that from happening?

I mean, how does PHP know to only give permission to do certin things when run? How would it know that since it's running out of my home dir. that it should be run as me, or be run as only what I have permission to. Does that make sence?

-ee99ee

PS -- I would never do that in a production enviroment, that's just an example for my question.

 

 

 

 

Top