Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a machine running Ubuntu 12.10. I have two user accounts setup, my account, and another user. I am able to run SUDO commands, but the other user isn't in the SUDO'ers list.

What I'm trying to do is give mininal permissions for the other user to run a single SUDO command. Basically to eject an Amazon Kindle USB device.

sudo eject /dev/sdc1

When plugging the Kindle in to the USB port, the device is mounted. If the user simply Ejects the device using the UI, the device is unmounted but not ejected - so the device can pull charge from the PC.

Ejecting the Kindle using the command above works on my account, allowing me to charge the Kindle. But when the other user is logged in, he can't run the command.

Is there a way to allow a user account to run a single command with SUDO permissions?

share|improve this question
    
You can try adding that user to the cdrom group instead –  dawud Apr 9 '13 at 9:11
add comment

1 Answer

Use sudoedit to edit the file /etc/sudoers

Underneath the line root ALL=(ALL:ALL) ALL

Enter the line below and replace ejectuser with the actual username ejectuser ALL=(root)NOPASSWD:/usr/bin/eject

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.