There may be times you would want to run perl scripts as non-root users. This offers more security to your system and this guide will show you how to enable perl to use setuid.
- Root access
- Updated ports
Before we can install perl with setuidgid, any previous version needs to be removed.
# cd /usr/ports/lang/perl5.8 # make deinstall
It’s ok if you get a message that says:
===> Deinstalling for lang/perl5.8 ===> perl not installed, skipping
Otherwise the current version of perl that’s installed will be uninstalled.
We need to edit the /etc/make.conf file to enable setuid perl.
# echo "ENABLE_SUIDPERL=true" >> /etc/make.conf
Now that we have told /etc/make.conf to enable setuid perl and uninstalled the currect version of perl, we can now go ahead and install perl 5.8.8 which is current as of May 2006. Now run the following and I would suggest doing this in a screen session as this can take some time.
# cd /usr/ports/lang/perl5.8 # make install clean
Perl is now installed with setuidgid.