[sudo-users] sudo problems with internal shell command

Stier, Matthew Matthew.Stier at us.fujitsu.com
Wed Feb 10 16:31:20 EST 2010


If you read the manpage, you can save invoking 'su' unnecessarily.

% sudo -s 'echo disable > /proc/acpi/ibm/bluetooth'

If this is being invoked within a script, you may wish to add the '-n'
option.


-----Original Message-----
From: sudo-users-bounces at courtesan.com
[mailto:sudo-users-bounces at courtesan.com] On Behalf Of Jeff Makey
Sent: Wednesday, February 10, 2010 4:05 PM
To: sudo-users at sudo.ws
Subject: Re: [sudo-users] sudo problems with internal shell command

Aaron Lewis wrote:
>sudo echo disable > /proc/acpi/ibm/bluetooth
>
>Permission is denied.
>I think it's because 'echo' is run in shell , as normal user  , then it

>fails to run.

No, it is the ">" redirection that runs without the privileges gained
via sudo.

>This works fine:
>sudo su - -c 'echo disable > /proc/acpi/ibm/bluetooth'
>
>Anyway to solve it ?

That *is* the solution.

                          :: Jeff Makey
                             jeff at sdsc.edu
____________________________________________________________ 
sudo-users mailing list <sudo-users at sudo.ws>
For list information, options, or to unsubscribe, visit:
http://www.sudo.ws/mailman/listinfo/sudo-users



More information about the sudo-users mailing list