`operation not permitted` running `ip link add` or `sysctl -w` inside a container.
IntermediateTroubleshootingSecurity, rootless, Podman and containerd
Answer
Likely causes → Missing capability (NET_ADMIN/SYS_ADMIN), or sysctl not namespaced.
Diagnose → docker exec c capsh --print (if available) or grep Cap /proc/1/status.
Fix → --cap-add NET_ADMIN for networking tools; set namespaced sysctls with --sysctl net.ipv4.ip_forward=1; host-wide sysctls must be set on the host.
Prevent → Add only needed capabilities.
More on Security, rootless, Podman and containerd
Rootless Docker: `dockerd-rootless.sh` fails with `newuidmap: write to uid_map failed: Operation not permitted`IntermediateRootless: `rootlesskit: failed to ... listen tcp 0.0.0.0:80: bind: permission denied`BeginnerRootless Docker stops when you log out of SSH.BeginnerRootless containers: `Error: ... cannot set up namespace using "/usr/bin/newuidmap": should have setuid or have filecaps setuid` (Podman).IntermediatePodman: `Error: short-name "nginx" did not resolve to an alias and no unqualified-search registries are defined in "/etc/containers/registries.conf"`BeginnerPodman rootless: `Error: cannot find newuidmap` / ping fails inside container: `ping: permission denied (are you root?)`.Intermediate