Re: [gentoo-user] confused about suid

2006-01-30 Thread Robert Persson
On Saturday 28 January 2006 01:35 Jorge Almeida was like:
  I am still having to sudo echo -n mem  /sys/power/status and then to
  enter a password. What am I doing wrong?

 Did you edit /etc/sudoers? Example:
 joeuser ALL = NOPASSWD: /your/command/here
 Remember to edit the file with visudo, which will warn you in case you
 make a syntax error.

Thanks! That works.
-- 
Robert Persson

Conspiracy Bears:
Once upon a time there were lots of conspiracy bears...


-- 
gentoo-user@gentoo.org mailing list



[gentoo-user] confused about suid

2006-01-28 Thread Robert Persson
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:

#!/bin/bash
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?

thanks
Robert
-- 
Robert Persson

Conspiracy Bears:
Once upon a time there were lots of conspiracy bears...

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] confused about suid

2006-01-28 Thread Uwe Thiem
On 28 January 2006 09:55, Robert Persson wrote:
 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:

 #!/bin/bash
 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

Your script is suid root but neither the shell executing it nor the external 
command /bin/echo is. 

Uwe

-- 
Unix is sexy:
who | grep -i blonde | date
cd ~; unzip; touch; strip; finger
mount; gasp; yes; uptime; umount
sleep
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] confused about suid

2006-01-28 Thread Harald Arnesen
Robert Persson [EMAIL PROTECTED] writes:

 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:

 #!/bin/bash
 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?

suid shell-scripts are not allowed, for security reasons.
-- 
Hilsen Harald.

-- 
gentoo-user@gentoo.org mailing list