I am running a docker image of Linux and trying to achieve following:
- Run a docker
- Create a user test
- Stop the user test from internet access
1 and 2 work but I am stuck at #3.
What I tried?
- Run
iptables -t mangle -A OUTPUT -o eth0 -m owner --uid-owner 501 -j DROP
. This command failed with error message "getsockopt failed strangely: Operation not permitted". I was unable to find the root cause - Change the sudoer file and add an entry
test ALL=!/bin/ping
. This was to see if I am able to stop user test from running ping command. However, this change in sudoer file had no affect and user test was able to run ping command. Assuming this would work, my intent was to play around with sudoer to achieve my goal
Is there a recommendation or suggestion to solve this problem?