I would like to be able to run a command, passing in parameters to bash or similar, such that this command is not allowed to write to a particular path, overriding the user's other privs.Eg:root> /bin/bash -protect /folder/to/protect mycommand.shIn this example, the root user can obviously do what it wants, but while I test a new script I'm writing, I would like to protect a folder, as if the folder was read only for that user.Is there a way to do this without adding a new user and adjusting that user's privs accordingly? It doesn't have to be in bash by the way, I don't mind the approach - as long as I can protect folders without adding a new user I don't mind!(I'm sorry about the title, I can't really think of how to explain my requirements in one line!)
Can I run a command with specific privileges on certain directories?
bash;permissions;files