Start programs inside unshare/lxc namespaces easily using UNIX sockets + easy access to capabilities, namespaces, chroot and others.
Start programs inside unshare/lxc namespaces easily using UNIX sockets + easy access to capabilities, namespaces, chroot and others.
Start processes in other network/mount/whatever namespace, as created by unshare or lxc-start
(as long as there is a shared filesytem between the host and container and you use recent enough Linux kernel).
Also allow users execute programs in other user account or in chroot in controlled way
(like sudo, but without setuid-bit in filesystem).
Works by sending file descriptors over UNIX socket.
See various usage examples and pre-built dive[d] versions at the github page.
Usage
…Features
For less feature-creep version see "nocreep" branch
Notes
socat -,raw,echo=0 exec:bash,pty,setsid,stderr (there's a hint in dive's usage message) as the program to start to have nicer bash/etc/security/limits.conf.For pre-build versions of dive and dived see "Releases". Note that some of pre-built versions may lack features.
A table of what happens to various process attributes when process is started
"remotely" over dive/dived compared to just execing directly.
"not preserved" means "like in dived" or "whatever", "preserved" means "like in dive"
or "like if we executed the program directly".
AttributeWhat happens
PIDnot preserved
parent PIDnot preserved
file descriptors preserved (unless -O)
resource limits not preserved
uid preserved if possible (unless -P or -u)
group list initialized by initgroups (unless -P or -u)
controlling terminal hopefully preserved (unless -T)
session id/process group not preserved, new session leader (unless -S)
namespaces memberships not preserved
cgroup membership not preserved
coredump_filter not preserved
current working directory preserved (unless -H)
/proc/.../exe not preserved
oom_score_adj not preserved
root directory not preserved (unless -r)
nice value/priority not preserved
CPU affinity not preserved
capabilities not preserved
umask preserved (unless -M)