LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Help with sudoers file (visudo) (https://www.linuxquestions.org/questions/linux-security-4/help-with-sudoers-file-visudo-405773/)

jasongunnisthedevil 01-20-2006 08:23 AM

Help with sudoers file (visudo)
 
I am trying to get my ipod to automatically unmount. The only way I can remove the do not disconnect sign from the ipod display is to run: sudo eject /media/ipod

What I want to do is automate this process with gtkpod so it unmounts properly when I exit the program. Gtkpod supports scripts on exit that I can write easily enough. However I need to find a way to use sudo eject without a password.

Here is my /etc/sudoers file. I have tried to set it so that I (user ben) can use the sudo eject command without a password. I have read the man pages but I can't seem to get it right and the nopasswd seems to have no effect. What am I doing wrong?

Code:

        # /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.
#

# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults

Defaults        !lecture,tty_tickets,!fqdn

# User privilege specification
root    ALL=(ALL) ALL
ben    ALL= NOPASSWD : /usr/bin/eject/

# Members of the admin group may gain root privileges
%admin  ALL=(ALL) ALL


I am using kubuntu 5.10 if that makes any difference to anybody.

jasongunnisthedevil 01-20-2006 11:38 PM

For anybody who has the same problem I think I have the answer. I added in a command alias specification for eject and now it works perfectly. Here's my new sudoers file.

Code:

        # /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.
#

# Host alias specification

# User alias specification

# Cmnd alias specification
Cmnd_Alias EJECT=/usr/bin/eject
# Defaults

Defaults        !lecture,tty_tickets,!fqdn

# User privilege specification
root    ALL=(ALL) ALL
ben  ALL= NOPASSWD : EJECT

# Members of the admin group may gain root privileges
%admin  ALL=(ALL) ALL



All times are GMT -5. The time now is 09:35 PM.