From the name program.sh
, I am guessing that you're trying to run an interpreted script, not an ELF binary. Linux has ignored the setuid bit on scripts since long ago, due to possible security issues (race condition between kernel checking the +s bit, and script interpreter opening the file).
If this script needs to be available to specific users, create a sudo
rule in /etc/sudoers that allows this:
xyz ALL=(root:root) NOPASSWD: /usr/local/bin/program.sh
There might be other solutions. For example, if you want to create home directories automatically (upon first login), the pam_mkhomedir.so
PAM module exists for this.