Gentoo Archives: gentoo-user

From: Jorge Almeida <jalmeida@××××××××××××.pt>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] confused about suid
Date: Sat, 28 Jan 2006 09:41:40
Message-Id: Pine.LNX.4.64.0601280928450.26585@jmaa.math.ist.utl.pt
In Reply to: [gentoo-user] confused about suid by Robert Persson
1 On Fri, 27 Jan 2006, Robert Persson wrote:
2
3 >
4 > I created a bash script (/usr/local/bin/suspendtoram) like so:
5 >
6 > #!/bin/bash
7 > echo -n mem > /sys/power/status
8 >
9 > then set owner and group to root:root and made the script suid.
10 >
11 > However this doesn't work. The error message goes:
12 >
13 > /usr/local/bin/suspendtoram: line 2: /sys/power/state: Permission denied
14 >
15 suid doesn't work with scripts (for security reasons, although I can't
16 say I understand what reasons).
17 >
18 > I am still having to "sudo echo -n mem > /sys/power/status" and then to enter
19 > a password. What am I doing wrong?
20 >
21 Did you edit /etc/sudoers? Example:
22 joeuser ALL = NOPASSWD: /your/command/here
23 Remember to edit the file with visudo, which will warn you in case you
24 make a syntax error.
25
26 Cheers,
27
28 Jorge Almeida
29 --
30 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] confused about suid Robert Persson <ireneshusband@××××××××.uk>