I have a program that captures network traffic off a network interface. (It's a C program sitting on libpcap
.)
I'm running Fedora 26.
When I run the program as root
, things look great:
[craig ~]$ sudo su -
[root ~]$ /home/craig/mybinary
(output is as expected)
But, when I run the program as myself (craig
), it fails:
[craig ~]$ /home/craig/mybinary
Operation not permitted
[craig ~]$ echo $?
1
What I want is any user who runs this program to run it "as root". I think I set the setuid
bit and owner/group appropriately:
[root@localhost ~]# chmod 6774 /home/craig/mybinary
[root@localhost ~]# ls -lah /home/craig/mybinary
-rwsrwsr--. 1 root root 1.3M Mar 7 2017 mybinary
But the behavior is unchanged - when I run this process as craig
, it fails with permission-related errors.
Am I missing a step/setting?