LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   sudoers question (https://www.linuxquestions.org/questions/linux-security-4/sudoers-question-385824/)

clickster 11-23-2005 09:43 AM

sudoers question
 
I am trying to set up sudo for a user account. I need the account to be able to run smbmount/smbumount to mount/unmount anything without having to enter a password. I have created the following command alias:

Cmnd_Alias MOUNTS = /usr/bin/smbmount, /usr/bin/smbumount

I have then added the following line for the user:

username ALL=NOPASSWD: MOUNTS

If I just run smbmount, it works in as far as it gives me a list of options for smbmount (if I take the line out of sudoers, it prompts for a password). However, once I add options, such as "sudo smbmount //server/share /local/dir" it prompts for a password. I've also tried it by listing out the commands rather than using a command alias with the same result. The problem seems to be with the way it deals with switches/options. I don't know all of the mounts the user will be using, so I can't simply list them all out in the sudoers file. How can I tell it to accept all switches along with the command itself? Any help would be greatly appreciated.

slano 11-24-2005 04:47 AM

I don't know exact answer for you question, but maybe you should try adding SUID bit (chmod 4755) to smbmount, smbumount executable, and make sure users are able to run it, and they will be able to run it with root permissions, therofre will be able to mount/unmount shares.
Hope it helps ;)


All times are GMT -5. The time now is 05:33 AM.