Password authentication when mounting drives in Thunar

Looks like you would need to create a polkit rule for udisk2 to mount partitions without asking for password. I dug around a bit and something like the following might work.

If you’re up to testing, create the file:

/etc/polkit-1/rules.d/10-udisks2.rules

with this content:

// Allow udisks2 to mount devices without authentication
// for users in the "wheel" group.
polkit.addRule(function(action, subject) {
    if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" ||
         action.id == "org.freedesktop.udisks2.filesystem-mount") &&
        subject.isInGroup("wheel")) {
        return polkit.Result.YES;
    }
});

Don’t know if you need a reboot. May not hurt.

11 Likes