I have an architecture using network namespaces (netns). I would like to allow regular users to do some operations in these netns.
I could write a script
netns-exec.sh, inspired by this post, executed with
ip netns exec $1 su $USER -c "$2"
and add to my sudoer file:
user ALL=(ALL) /path/to/netns-exec.sh
But I find it so ugly I could totally have nightmares about it. Is there a better solution to allow regular users to use namespaces? Is it possible to put users to some useful groups? I searched about it but found nothing.