I can mount my drive using sudo mount.cifs ...... I can unmount doing sudo umount /mnt/mountpoint
It was prompting me for a password, so I changed the sudoers file to NOPASSWD:ALL and now it does not prompt me.
I have an application and I want to be able to mount drives by anyone with access to that application when they run it, but if I do sudo -u username mount.cifs.... it then prompts me for the users password trying to do this. This will all be scripted or commands being executed as if from the command line.
What I need it to do is provide anyone that runs the application the ability to at least do the mount command although I would also like it to be able to create directories (mkdir) as well so that I can create mounts from a control file and it could then create the directory and then connect based on the parameters given. I already have the code written to check to see if the mount exists and then create or connect if it is not, but don't know how to get around how the sudo command is working.
I want to avoid writing this so that every time a resource is not available and a mount drops, it does not need to send a message to have someone log in and manually do it.