Web Programming, Linux System Administation, and Entrepreneurship in Athens Georgia

Fix for CentOS “Can’t do setuid (cannot exec sperl)”

If you are running a Perl script with the setuid bit, it actually runs a slightly modified version of Perl so that it is a bit more cautious. On a CentOS box, you need to install the ‘perl-suidperl’ package to get the necessary files installed. Otherwise you get an error like this:

[root@host bin]# ls -al myscript.pl
-rws--S--- 1 mail mail 1218 Oct  1 13:09 myscript.pl

[root@host bin]# ./myscript.pl
Can't do setuid (cannot exec sperl)

3 Comments

  1. Apophys

    Thank you for the tip ! I was blocked because of that.

  2. Andy Pallett

    Thanks for this fix. It solved my issue with Apache running BackupPC perl Scripts 🙂

  3. Nic

    Thanks! This helped us get AWStats working again

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2025 Brandon Checketts

Theme by Anders NorenUp ↑