LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Need help with visudo (https://www.linuxquestions.org/questions/debian-26/need-help-with-visudo-267975/)

powadha 12-19-2004 03:11 AM

Need help with visudo
 
I need to edit to sudoers file so mount-usb works with users. As root I'm all done and it works brilliantly (I'll post the whole install steps later, haven't seen anything about it here). Only problem left is that it doesn't work for users. The error must be in my sudoers file, I'm not sure if the lines suggested work on deb:

5) Setup a /etc/sudoers entry for /usr/local/bin/usb-mount
and /usr/local/bin/usb-umount, such as

ALL viking2=NOPASSWD: /usr/local/bin/usb-mount
ALL viking2=NOPASSWD: /usr/local/bin/usb-umount

Replace viking2 with your hostname. Note that these two
lines grant passwordless execution of these two commands as
root - all my users are trustworthy, so I'm happy to do
this.

I tried this but didn't work. How to get there?

TLV 12-19-2004 03:29 AM

I've never tried the NOPASSWD option, but I do the same and let a user sudo a mount command. What you are doing is allowing your user(s) to run the usb mounting scripts in /usr/local/bin, you are not allowing them to run the mount command.

What I do to let my user mount the USB drive is to setup the /etc/fstab file as:

/dev/sda1 /mnt/usb vfat user,noauto 0 0

With this I don't need sudo for mounting...

/TLV

Dead Parrot 12-19-2004 05:04 AM

Don't know if this will help, but I've got here a single user machine that lets a normal user, xparrot, to halt and reboot the computer without password. My /etc/sudoers has a line:
Code:

xparrot  ALL = (ALL) NOPASSWD: /sbin/halt, /sbin/reboot
And my ~/.bash_profile has these lines:
Code:

alias  halt="sudo /sbin/halt"
alias  reboot="sudo /sbin/reboot"



All times are GMT -5. The time now is 04:10 PM.