A setuid binary you built doesn't run as root: it still runs with the caller's UID.
AdvancedTroubleshootingPermissions, ownership, SELinux and mounts
Answer
Likely causes → The filesystem is mounted nosuid, the binary is a script (the kernel ignores setuid on scripts), or the owner isn't root.
Diagnose →
ls -l /opt/tool/bin/helper # expect -rwsr-xr-x root
findmnt -no OPTIONS --target /opt/tool/bin/helper
file /opt/tool/bin/helper
Fix → Avoid setuid entirely: use a narrow sudo rule or file capabilities (setcap cap_net_raw+ep helper). If setuid is really needed, place a compiled binary on a filesystem without nosuid.
Prevent → Treat any setuid requirement as a security review item.
More on Permissions, ownership, SELinux and mounts
nginx returns 403 and logs `open() "/srv/www/index.html" failed (13: Permission denied)`, even after `chmod -R 777 /srv/www`.IntermediateA script fails with `bash: ./deploy.sh: Permission denied` even though `ls -l` shows `-rwxr-xr-x`.BeginnerA script fails with `/bin/bash^M: bad interpreter: No such file or directory`.BeginnerA user gets `-bash: cd: /srv/project: Permission denied` although they're in the group that owns `/srv/project` (mode `770`).BeginnerApache can't connect to a backend: `AH00957: HTTP: attempt to connect to 127.0.0.1:8080 (localhost) failed` and `ausearch` shows `denied { name_connect }`.IntermediateA service fails to bind to a custom port: `bind() to 0.0.0.0:8888 failed (13: Permission denied)` while running as root.Intermediate