Password authentication when mounting drives in Thunar

I just decided to swith to EnOS on my main PC (hurray! :grin:)
Anyway, I am just ironing out some rough edges that I didn’t know existed on my previous distros.

For example now when I want to mount internal HDD in Thunar it requires a password.
Is it possible to find out how is this action handled and modifies so that I do not need a password? Where should I start looking?
Full time mount in fstab is possible but I would rather keep it unmounted in case I do something stupid with rm -rf :wink:.

1 Like

You might want to add some options to the mounts in /etc/fstab, for example:

LABEL=Xyz  /Xyz  ext4 noatime,nofail,x-systemd.device-timeout=3s,x-systemd.automount,x-systemd.idle-timeout=10min

(This on is for a USB stick, so maybe not the thing you wanted.)
Look for the Arch wiki about these options.

I think you would need noauto mount option for the partition to not be mounted at boot but “on demand”.

@manuel , @pebcak thank you for the reply but it is not exactly what I wanted. Yes, it mounts the drive without password but also it requires an entry in fstab.

I was probably more interested it the way how other distros (for example Xubuntu or Manjaro) mounts additional drives through Thunar without a necessity to input password.
It looks like I am able to mount USB drive this way but internal HDD requires password. Is it just about proper configuration of udisks/udev?

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.

6 Likes

Yes, this looks like the thing I wanted. I never actually messed with polkit. It looks like I have some reading to do.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.