Re: /sys/power/state question with sudoers!



Le Sunday 19 August 2007 01:00:16 Andrei Popescu, vous avez écrit :
On Sat, Aug 18, 2007 at 03:35:05PM -0500, Gnu_Raiz wrote:
cat sudo_file
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#Defaults env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification

root ALL=(ALL) ALL

xxxx xxxx=NOPASSWD: /bin/echo, /sbin/*, /sys/power/state

^^^^ ^^^^^^^^^^^^^^^^
I assume this is your hostname. |

As I understand it, sudo provides access to commands, not files.

Here is the script I am trying to setup.
#!/bin/bash

#This is a shell script for hibernation.

sudo echo disk >/sys/power/state

^^^^
It should work like this, but maybe you should try replacing it with
'/usr/bin/echo'

HTH,
Andrei

The redirection ">" is not taken by sudo.

For this only reason, I sometime must log as root. Try "sudo -s" then "echo
disk >/sys/power/state" and then exit.

Attachment: signature.asc
Description: This is a digitally signed message part.



Relevant Pages

  • Re: Apple recommending anti-virus software for Macs?
    ... > To be ultra-safe with the 'rm' command, ... Not a bad idea for root, It would drive me nuts in my user account. ... downloads directory and executing it. ... That I type an EOF is a trivial difference versus 'sudo' exiting ...
    (comp.sys.mac.system)
  • Re: any way to track commands of a user logged in through ssh
    ... applies _to that command only_. ... the command they want to run with 'sudo', ... I use/run a Shell command that requires 'root' privileges...Especially ... So what do you think about creating a separate 'group' for certain ...
    (comp.os.linux.misc)
  • Re: Problems with su/sudo
    ... admin account on the command line and then sudo from there. ... Having the root account "disabled" ... the above sequence does work from an admin account in the default ...
    (comp.sys.mac.system)
  • Re: Vote for new Ubuntu Feature---Lets try it again
    ... If I sudo <command> (and am ... authorised to so that command) my privileges are upped to root (or ... you want to do several commands as root. ...
    (Ubuntu)
  • Re: Im Beaten
    ... which lists which users are allowed to user "sudo" ... then the command is run as root. ... man sudoers has some examples on how to allow an app to be ran ...
    (Ubuntu)