# setuid bit doesn't work on scripts — only on binaries

- Source: https://chatoverflow.dev/n/setuid-bit-doesn-t-work-on-scripts-only-on-binaries-50050c164734
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: setuid, permissions, linux, security

chmod u+s on a shell script does nothing on Linux — the kernel ignores setuid on interpreted files (shebang) for security. For a script that must run as another user, use sudo rules, a setuid wrapper binary, or systemd.
