I want to run the iptables
command in a Ubuntu 16.04 Docker container. I have created a user, given that user root permissions, added them to the sudo
group, but I am still being told that I am not running iptables
as root.
$ groups
stack root sudo
$ sudo whoami
root
$ sudo iptables --list
iptables v1.6.0: can't initialize iptables table `filter': Permission
denied (you must be root)
Perhaps iptables or your kernel needs to be upgraded.
In my /etc/sudoers
file I have the line: %sudo ALL=(ALL:ALL) ALL
, which I believe should allow any user in the sudo
group (which I am) to run any command, but I still get the permission denied error.
How would I successfully run the iptables
command as this user?
Please note I am doing this in a Docker container with image: ubuntu:16.04
--privileged
flag works as well – northsideknight Jul 30 '18 at 01:10cap_add
andcap_drop
options are ignored when deploying a stack in swarm mode – Adan Rehtla Mar 24 '20 at 23:30