read.me 323 B

123456789101112
  1. #copy this dir ASP/netns to /opt/ as root
  2. cp netns /opt/
  3. chown -R root:root /opt/netns
  4. # add with sudo visudo
  5. user ALL=(ALL) NOPASSWD:/opt/netns/_exec, /opt/netns/create
  6. # now "user" can create "ip netns" with
  7. sudo /opt/netns/create 14
  8. # and attache as "user" any cmd to it with
  9. /opt/netns/exec --id=14 --cmd=bash