You are not logged in.

#1 2022-01-01 17:04:15

Teeeeze
Member
Registered: 2021-06-19
Posts: 14

udisks2 requires password authentication for some but not others

I have 2 HDD hooked up on my system.

sdb           8:16   0   1.8T  0 disk
└─sdb1        8:17   0   1.8T  0 part 
sdc           8:32   0   3.6T  0 disk
├─sdc1        8:33   0   1.9T  0 part 
└─sdc2        8:34   0   1.7T  0 part

When I use

$ udisksctl mount -b /dev/sdc1

I don't get any prompt for my password.
Same goes for sdc2

But when I do

$ udisksctl mount -b /dev/sdb1

I get

==== AUTHENTICATING FOR org.freedesktop.udisks2.filesystem-mount-system ====
Authentication is required to mount Samsung SSD 860 EVO 500GB (/dev/sdb1)
Authenticating as: tiz
Password:
==== AUTHENTICATION COMPLETE ====
Mounted /dev/sdb1 at /run/media/tiz/UUID

And same goes for some other drives as well.

Why is that?
Can I fix this problem?

Offline

#2 2022-01-02 13:06:45

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,212

Re: udisks2 requires password authentication for some but not others

Which file systems?

Offline

#3 2022-01-02 16:28:12

Teeeeze
Member
Registered: 2021-06-19
Posts: 14

Re: udisks2 requires password authentication for some but not others

NAME        FSTYPE FSVER LABEL      UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1      vfat   FAT32            71A3-5SED
├─sda2      ext4   1.0              798dd5f7-9846-jfld6-aa33-de4758192540
├─sda3      swap   1                a736b947-7da3-420d-b52j8-225feecbc5fd
├─sda4
└─sda5      ntfs         New Volume BJFALGGE2D991C
sdb
└─sdb1      ext4   1.0              66739d435-ddb0-4d0c-afe6-d819658dfd70    1.2T   
sdc
├─sdc1      ext4   1.0              dc084bed-5caa-422a-bgoo4-e808ddb0e745
└─sdc2      ext4   1.0              6anspara4-055f-40f0-8781-a6837e702b97

I tested every partitions, and this is what I found:

Authentication Required:
sda1
sda2
sda5
sdb1

Not required:
sdc1
sdc2

I think it kind of makes sense for sda1~3 because it has different OS setup. I don't understand why it requires authentication for that though.

The partition that I desperately want/expect to be mounted without any authentication is sdb1
I had just formatted it using cfdisk .
I think I have never had problem with using udisksctl without authentication by now.

I'd like to know what exactly is authentication for first, and why a normal USB drive requires authentication next.

Offline

#4 2022-12-20 18:51:02

scres
Member
Registered: 2021-04-12
Posts: 2

Re: udisks2 requires password authentication for some but not others

You'll want to put the following in /etc/polkit-1/rules.d/10-udisks2.rules

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

Should work automatically as long as you're in wheel.

credit

Offline

Board footer

Powered by FluxBB