In file managers (e.g. Thunar), when you try to mount a drive, you might see that you need to enter the root password to continue every single time you want to mount and unmount a drive. This can be bypassed by setting a [[polkit]] rule.

+

In file managers (e.g. Thunar), when you try to mount a drive, you might see that you need to enter the root password to continue every single time you want to mount and unmount a drive. This can be bypassed by setting a polkit rule as shown in [[Polkit#Allow mounting a filesystem on a system device]].

−

−

In the directory {{ic|/usr/share/polkit-1/rules.d}}, create this file named {{ic|10-drives.rules}}:

−

−

polkit.addRule(function(action, subject) {

−

if (action.id.indexOf("org.freedesktop.udisks2.") == 0){

−

return polkit.Result.YES;

−

}

−

}

−

);

−

−

Drives will now mount without any intervention from you. If you need to specify which users can perform this action or other restrictions, refer to polkit manual page.

Installation

GVFS without root password

In file managers (e.g. Thunar), when you try to mount a drive, you might see that you need to enter the root password to continue every single time you want to mount and unmount a drive. This can be bypassed by setting a polkit rule as shown in Polkit#Allow mounting a filesystem on a system device.