Linux - Sudo - Sudoers - Only allow one user to be able to mount/unmount

You need to spell out the full mount command (not /sbin/mount.cifs):

user ALL = NOPASSWD: /bin/mount /path-to-device /mnt/folder, /bin/umount /mnt/folder

NOTE: There might be some options you want to specify after “mount”, e.g. “-o ro”, “-t cifs”, etc.

  • The user will then need to type the command-line exactly as it appears in sudoers (if they are not that savvy, create them an alias).