Теги

udisks2 + polkit: Allow unauthenticated mounting

Annoyed by entering root password during mounting external USB disks?

Answer: Create file /etc/polkit-1/rules.d/10-udisks2.rules with following content

// See the polkit(8) man page for more information
// about configuring polkit.

// 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;
    }
});