我想创建一个新用户(或组),以便与该用户一起运行的任何应用程序都无法连接到网络。
@Michael Kjörling 我已按照您的建议(使用 Ubuntu 12.04 64 位)并得到了一些错误信息:
$ sudo iptables -A OUTPUT -m owner --uid-owner xyz ! -i lo -j REJECT --reject-with network-unreachable
iptables v1.4.12: unknown reject type "network-unreachable"
Try `iptables -h' or 'iptables --help' for more information.
$ sudo iptables -A OUTPUT -m owner --uid-owner xyz ! -i lo -j REJECT
iptables v1.4.12: Can't use -i with OUTPUT
Try `iptables -h' or 'iptables --help' for more information.
$ sudo iptables -A OUTPUT -m owner --uid-owner xyz ! -j …Run Code Online (Sandbox Code Playgroud)