Originally posted by chandru.in
I did this to get it working, as root type what is below,
chmod 4777 halt
chmod 4777 shutdown
yes. and a user does "cat /bin/bash > /sbin/shutdown"
Instant suid shell (i know that the suid bit is supposed to be turned off but it doesn't happen all the time)
Even if this scheme was a good solution the right command would be
But, let me say again.
"Shutdown wasn't designed to be run setuid."
(From the shutdown manpage)
It doesn't mean that it won't work. It will work ok, but the author mentions that shutdown has not been written with the thought
that it would be run setuid, so they didn't take the measures that are needed from security point of view.
If you don't care about security or you have few/trusted users or whatever then do it.
chmod 4755 halt shutdown"
But, I (and the author whose opinion has more weight than mine) don't recommend it.