LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-20-2006, 08:23 AM   #1
jasongunnisthedevil
LQ Newbie
 
Registered: Aug 2005
Location: New Zealand
Posts: 8

Rep: Reputation: 0
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.
 
Old 01-20-2006, 11:38 PM   #2
jasongunnisthedevil
LQ Newbie
 
Registered: Aug 2005
Location: New Zealand
Posts: 8

Original Poster
Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
visudo lets me edit sudoers but not save ver 3.3.1 suguru MEPIS 4 12-19-2005 06:23 AM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM
sudoers file cactus-bob Linux - Newbie 2 03-11-2004 11:24 AM
help with sudoers file ogden2k Linux - Security 4 03-11-2003 10:39 AM
The Sudoers File Rubicone Linux - Security 0 05-02-2002 06:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration