Established method to enable suid scripts?

Devin Teske dteske at
Wed May 11 02:19:32 UTC 2011

On May 10, 2011, at 5:54 PM, Chris Telting wrote:

> I've googled for over an hour.
> I'm not looking to get into a discussion on security or previous bugs that are currently fixed.  Suid in and of itself is a security issue.  But if you are using suid it it should work; I don't want to use a kludge and I don't want to use sudo.  I'm hoping it's a setting that is just disabled by default.

The reason that the suid bit doesn't work on scripts (shell, perl, or otherwise) is because these are essentially text files that are interpreted by their associated interpreter. It is the interpreter itself that must be suid.

In other words, you'd have to do this (*WARNING* highly inadvisable -- even for the OP):

	sudo chmod u+s /bin/sh

before you could have a shell script such as this:

	: anything

run as the suid user (the owner of /bin/sh -- usually root).


The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.

More information about the freebsd-questions mailing list