Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Similar to how I can run time command, I'd like to run a command such as dont_allow_network_access command. Is this possible?

share|improve this question

You can achieve this with lxc. This package contains a tool named lxc-unshare which you can use as follows:

# lxc-unshare -s NETWORK -- su username -c 'ping'
share|improve this answer
unshare from util-linux does the same thing. – grawity Oct 14 '12 at 16:26

This will get you a list of your network devices:

ifconfig -a

If your device you want to diable is eth0

ifconfig eth0 down

and to turn it back on:

ifconfig eth0 up
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.