1 |
Robert Persson <ireneshusband@××××××××.uk> writes: |
2 |
|
3 |
> I am trying to create a script so users can execute a certain command |
4 |
> as root without entering a password. I thought suid was the way to do |
5 |
> this, but I am not having any success. |
6 |
> |
7 |
> The command I want to execute as root is "echo -n mem > /sys/power/status". |
8 |
> |
9 |
> I created a bash script (/usr/local/bin/suspendtoram) like so: |
10 |
> |
11 |
> #!/bin/bash |
12 |
> echo -n mem > /sys/power/status |
13 |
> |
14 |
> then set owner and group to root:root and made the script suid. |
15 |
> |
16 |
> However this doesn't work. The error message goes: |
17 |
> |
18 |
> /usr/local/bin/suspendtoram: line 2: /sys/power/state: Permission denied |
19 |
> |
20 |
> |
21 |
> I am still having to "sudo echo -n mem > /sys/power/status" and then |
22 |
> to enter a password. What am I doing wrong? |
23 |
|
24 |
suid shell-scripts are not allowed, for security reasons. |
25 |
-- |
26 |
Hilsen Harald. |
27 |
|
28 |
-- |
29 |
gentoo-user@g.o mailing list |