1 |
On 28 January 2006 09:55, Robert Persson wrote: |
2 |
> I am trying to create a script so users can execute a certain command as |
3 |
> root without entering a password. I thought suid was the way to do this, |
4 |
> but I am not having any success. |
5 |
> |
6 |
> The command I want to execute as root is "echo -n mem > /sys/power/status". |
7 |
> |
8 |
> I created a bash script (/usr/local/bin/suspendtoram) like so: |
9 |
> |
10 |
> #!/bin/bash |
11 |
> echo -n mem > /sys/power/status |
12 |
> |
13 |
> then set owner and group to root:root and made the script suid. |
14 |
> |
15 |
> However this doesn't work. The error message goes: |
16 |
> |
17 |
> /usr/local/bin/suspendtoram: line 2: /sys/power/state: Permission denied |
18 |
|
19 |
Your script is suid root but neither the shell executing it nor the external |
20 |
command /bin/echo is. |
21 |
|
22 |
Uwe |
23 |
|
24 |
-- |
25 |
Unix is sexy: |
26 |
who | grep -i blonde | date |
27 |
cd ~; unzip; touch; strip; finger |
28 |
mount; gasp; yes; uptime; umount |
29 |
sleep |
30 |
-- |
31 |
gentoo-user@g.o mailing list |