Prevent normal users to mount (or unmount) partitions using gnome-disks

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
brancalessio
Level 1
Level 1
Posts: 41
Joined: Fri Jul 24, 2015 4:59 am

Re: Prevent normal users to mount (or unmount) partitions using gnome-disks

Post by brancalessio » Mon Sep 09, 2019 1:27 pm

gm10 wrote:
Sun Sep 08, 2019 4:10 pm
As I mentioned before, that's working as intended, the default policy is to let any user mount new filesystems (otherwise you couldn't use USB sticks or things like that), and if it's the user that mounted it then the same user can also unmount it again. Other users cannot without invoking root rights, however.
I think that now everything is explained. The point is that for gnome-disks a partition is a partition and maybe a user needs to mount it (for example, as you say, a usb-stick). I wrongly assumed that gnome-disks could make a difference between a partition on the internal hard drive and a usb-stick. It seems it is not the case.

Thank you for your help!

brancalessio
Level 1
Level 1
Posts: 41
Joined: Fri Jul 24, 2015 4:59 am

Re: Prevent normal users to mount (or unmount) partitions using gnome-disks

Post by brancalessio » Mon Sep 09, 2019 1:29 pm

Spearmint2 wrote:
Sun Sep 08, 2019 4:43 pm
why not just comment them out in the fstab file? Put # in front of those lines. That way if you change your mind later, at least they will be there where you can set to mount them again. Might check the mtab file also, remove if in there.
No, I do not want to do this. I actually added the lines in fstab because I want to try to modify the default behaviour of gnome-disks.

gm10
Level 18
Level 18
Posts: 8742
Joined: Thu Jun 21, 2018 5:11 pm

Re: Prevent normal users to mount (or unmount) partitions using gnome-disks

Post by gm10 » Mon Sep 09, 2019 3:08 pm

If it helps, you can mount with specific permissions. For example, uid=1000,umask=0077 in the mount options will make mount only accessible to the user with the id 1000. So you could auto-mount with that so it will always be mounted but only for that user. Of course your administrative users can always get access, as I said, no restrictions can be placed on them.
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

Post Reply

Return to “Installation & Boot”