I am trying to create a script so users can execute a certain command as root
without entering a password. I thought suid was the way to do this, but I am
not having any success.
The command I want to execute as root is "echo -n mem > /sys/power/status".
I created a bash script (/usr/local/bin/suspendtoram) like so:
echo -n mem > /sys/power/status
then set owner and group to root:root and made the script suid.
However this doesn't work. The error message goes:
/usr/local/bin/suspendtoram: line 2: /sys/power/state: Permission denied
I am still having to "sudo echo -n mem > /sys/power/status" and then to enter
a password. What am I doing wrong?
Once upon a time there were lots of conspiracy bears...
firstname.lastname@example.org mailing list