4
I have an executable created by my userid that I need to have run as root. Therefore I need to change the ownership of my executable to be root:root and use setuid. When I attempt
sudo chown root:root [EXE_NAME]
I get the error:
chown: changing ownership of `[EXE_NAME]`: Operation not permitted
My constraints are:
- I have sudo ALL ALL for my userid in the sudoers file, but cannot login as root
- The executable that needs to run as root is attempting to bind to a network interface (hence the need to run as root) in promiscious mode using the pcap_open_live function.
Is there a better way to solve my ultimate problem, that is, needing to run an executable that binds to a network interface that is secure and does not require sudo or creating a root owned shell (sudo tcsh
)
Which OS are you using? BSD? OSX, GNU/Linux? – Hennes – 2012-09-19T22:10:32.027
GNU/Linux RHEL 6.2 – EmRhap – 2012-09-19T22:16:59.520
See @Dennis's answer: if the file is on a filesystem that doesn't support ownership (like vfat or smb), then you can't change it. – Stefan Seidel – 2012-09-20T12:47:23.557