Say I run a program like so:
cd foo && program x y z
How can I give program
access to only the directories in foo
and below?
Pretend my fs looks like:
$HOME/
foo/
bar/
baz/
if I run program
in the foo/
dir, it obviously shouldn't have access to what's in bar/
or baz/
, etc.
NOTE: My distro is Ubuntu 16.04 if that makes any difference.
unshare
command was on my CentOS 7.x by default.unshare
cmd is inutil-linux-2.23.2-43.el7_4.2.x86_64
. Thats part of defs. I've never contemplated usingchroot
or any of this directly, usually just go to adocker
container instead. – slm Jul 09 '18 at 17:57run x
, whererun
is a program that will give thex
executable only permissions to directories below cwd, etc. – Alexander Mills Jul 12 '18 at 05:00