Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So Linux does an excellent job in managing rights per user. You all know the file and process management.

But is it also possible to create a virtual private network interface?

Say Linux user John Doe (jdoe) wants to test network software without being root and disturbing the real netif. Can you create an interface that belongs to jdoe only? Like eth0, eth1 and ethJdoe, making ethJdoe belonging to jdoe.

share|improve this question
up vote 2 down vote accepted

create a command that let jdoe run 'ifconfig eth0 [whatever]' (e.g. a shell script) let him use sudo to run the command. if you worry about him doing anything too wrong, add code to prevent pipe, etc. being passed onto the command.

this would be easier than hacking the network stack.

share|improve this answer
FYI, pipes are never passed to sudo commands. – grawity Jun 3 '11 at 12:13
@grawity: i mean when they sudo the shell script, the shall script may insert [whatever] into the command. they need to write that into the shell script. – bubu Jun 3 '11 at 14:26
Isn't it a security nightmare to proof the shell script 'if eth0 [whatever]'? – bbaja42 Jun 3 '11 at 17:23
yes but if you can entrust a user to do with an interface, that's a lot of trust. if you ever think you need to truly security proof something (under linux, that is) but giving interface control to somebody, the decision maker is likely smoking crack. – bubu Jun 3 '11 at 17:49
Thank you all, I was just curious if that was possible at all. – pwn4g3 Jun 11 '11 at 10:22

Not that I know of in Linux. What network software depends on him doing ifup and ifdown? I know I barely know your problem, but this sounds like a job for a Virtual Machine image.

The design of some microkernels allows 'drivers' in user level which can do things like this, but there's not a true microkernel out there that can do this and will actually run useful software. The Hurd always had things like this as an example of why the design was cool, but the Hurd is still not useful for anything but research purposes.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .