User Tools

Site Tools


linux:sudo:sudoers:only_allow_one_user_to_be_able_to_mount_unmount

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).
linux/sudo/sudoers/only_allow_one_user_to_be_able_to_mount_unmount.txt · Last modified: 2023/07/17 21:33 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki