I've been mounting removable drives by giving a usergroup sudo privileges to /bin/mount and /bin/umount.
I now want to use udisks. I have Dbus installed and I also have p11-kit installed through dependency resolution for some other apps. I have now installed policykit.
In /etc/polkit-1/rules.d, there is this file:
20-plugdev-group-mount-override.rules
Code:
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.udisks2.filesystem-mount" &&
subject.isInGroup("plugdev")) {
return polkit.Result.YES;
}
});
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.udisks2.eject-media" &&
subject.isInGroup("plugdev")) {
return polkit.Result.YES;
}
});
Now the user is part of %plugdev but I'm still only able to mount a drive using sudo:
Code:
sudo udisksctl mount -b /dev/sd**
It's my understanding that I should be able to mount without sudo as the user is in the correct group and polkit should return YES.
Code:
$ udisksctl mount -b /dev/sd**
Error mounting /dev/sdd1: GDBus.Error:org.freedesktop.UDisks2.Error.NotAuthorized: Not authorized to perform operation (polkit authority not available and caller is not uid 0)