Linux – Allow regular user to use mount without SUDO or FSTAB

cifslinuxmountsudo

Our desktop workstations are linux.

Each user uses Active Directory to authenticate. Mount does not automatically use the users PAM credentials to authenticate against a remote mount point – you must use either a credentials file or type in your username/domain/password on the command line.

Each user has encrypted home directories and they mount their remote mount points to a directory structure under their home directory.

Each user has different access rights on the domain and they want to keep their credentials file in their local plasma-vault.

Unfortunately, even when the plasma-vault is open, the moment they use sudo to run mount, the sudo process runs as root, who can not see the contents of the vault.

So, I need to have the users be able to run mount, under their own home directory, without the need for /etc/fstab via sudo.

How do I do this?

Best Answer

sudo is not only used for elevating a user to full root access.

Edit the /etc/sudoers file to allow your uses to use mount and umount. Use the sudo visudo to ensure the file permissions are kept the same.

The edit would include a line such as this:

username ALL=(ALL) NOPASSWD: /usr/bin/mount, /usr/bin/umount

For more options, see the sudoers manual.

Related Question