1

I was wondering if there's a way to run shell commands that affect only a certain directory and its subdirectories.

I'm using PHP and I want to make an app that allows the user to execute shell commands from a web page, but I want these commands to be restricted to a directory only

1 Answer 1

3

Avoid running any commands on your host machine originating from a web page. That's a recipe for disaster.

Have a look at operating system level virtualization. Depending on your OS you can use zones, jails or LXC.

Those OS level instances have a very low overhead and can be fired up pretty quickly. They do provide separation between the host OS and the user's environment. It's not as safe as a fully virtualized machine, but it might be sufficient for your use case.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.