You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Pekka Ekman 2d114a8330 Add license and README 8 years ago
iproute2@ead954cbd4 Initial commit 8 years ago
.gitignore Initial commit 8 years ago
.gitmodules Initial commit 8 years ago
COPYING Add license and README 8 years ago
Makefile Initial commit 8 years ago
README.md Add license and README 8 years ago
netns-exec.c Add license and README 8 years ago

README.md

netns-exec

Runs command in Linux network namespace as a normal user. Does essentially the same as sudo ip netns exec <netns> sudo -u "$USER" <command>, but doesn't require sudo privileges or password.

This is a simple suid root program built around the code of ip netns exec command of iproute2 utility suite. The iproute2 source is embedded in this git repository as a submodule.

Usage

Run command:

netns-exec [--] <netns> <command> <args>...

Start shell:

netns-exec [--] <netns>

Show help:

netns-exec -h
netns-exec --help

Building and installing

git submodule update --init
make
sudo make install

Security note

This program is installed as suid root. Normally, only root can execute anything in a different network namespace. This program intentionally bypasses this restriction and should not be installed in a machine where this is a problem.