My python script needs at least the CAP_NET_RAW capability, because it's using a pcap library, but I don't want to use sudo (and in fact sudo causes my script to not work properly, with the script's use of the subprocess module).
When I try
sudo setcap cap_net_raw=pie test.py
unable to set CAP_SETFCAP effective capability: Operation not permitted
When I do
sudo getcap /sbin/setcap
I get no output, so I have a feeling that setcap needs the CAP_SETFCAP capability? I've only found out about "capabilities" today, and from a quick search I get the feeling that setcap should work out of the box, so I'm lost.
I should have mentioned that this is on a Virtual Private Server.
$ df -T Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/simfs simfs 26214400 10373184 15841216 40% / tmpfs tmpfs 817152 0 817152 0% /lib/init/rw tmpfs tmpfs 817152 0 817152 0% /dev/shm $ cat /etc/fstab proc /proc proc defaults 0 0 none /dev/pts devpts rw 0 0