0

I have a very specific command I'd like anyone to be able to run. For the sake of example, let's pretend the command is ip addr flush dev foo0.

I found this and this. Unless I'm misunderstanding something, I think it's exactly what I need.

echo "ip addr flush dev vboxnet0" > script.sh
chmod +x script.sh

chmod +s script.sh
sudo chown root script.sh
sudo chgrp root script.sh

But then,

./script.sh
Failed to send flush request: Operation not permitted

Why?

Yd Ahhrk
  • 151
  • suid does not take effect on scripts. –  May 26 '16 at 22:53
  • @adonis Oh, bummer. Well, is that not the answer? Why did you post it as a comment? – Yd Ahhrk May 26 '16 at 22:56
  • imo, 1 line answers are not that good. I'll have to find relevant links to provide and think about how to be clear, etc. A comment seems easier sometimes. –  May 26 '16 at 23:00

1 Answers1

-1

I came across this situation some weeks back and found this in the course of my research. Perhaps it will help you as well.

https://superuser.com/a/636800