IceBlackz
Posts: 15
Joined: Mon Feb 24, 2014 9:38 am

[SOLVED] USB stick authorization error

Fri Mar 07, 2014 8:44 am

Hello,

I am planning to use my Arch Linux RaspPi from remote desktop only, therefore I use xrdp to make this able (eventually it's gonna be VPN tunnelled).
However, when I try to connect an USB stick while in remote access, it gives me a "Not authorized" error and the USB device is not mounted. When logged in locally/physically everything works fine and the USB stick just mounts.

I am able to mount it manually via sudo, but I want it mounted automatically without requiring the user to take any actions. I installed udiskie in the hopes that it would fix that, but the same error still occurs. When I run sudo pcmanfm it does also mount, but won't be accessible when using pcmanfm as non-root.

Also, I tried to add a polkit rule via /etc/polkit-1/rules.d/00-early-checks.rules:

Code: Select all

polkit.addRule(function(action) {
    if (action.id == "org.freedesktop.udisks2.filesystem-mount-system") {
        return polkit.Result.YES;
    }
});
After adding this rule I do see it is read correctly when launching sudo /usr/lib/polkit-1/polkitd, but still it won't automount when logged in via rdp.

I feel like that if I'm able to launch udiskie as root from /etc/xrdp/startwm.sh, it might be mounted automatically but I don't know how to run something as root from there.

Maybe there are other solutions, please let me know!

IceBlackz
Posts: 15
Joined: Mon Feb 24, 2014 9:38 am

Re: USB stick authorization error

Fri Mar 07, 2014 12:45 pm

Aaah, finally found a solution after 2 days of full time work..

I eventually found this link of the udiskie program itself:
https://pypi.python.org/pypi/udiskie

Specifically this part was interesting:
..
Alternatively, change the setting for allow_inactive to yes in the file /usr/share/polkit-1/actions/org.freedesktop.udisks.policy:

Code: Select all

<action id="org.freedesktop.udisks.filesystem-mount">
    ...
    <allow_inactive>yes</allow_inactive>
    ...
</action>

...
Do this for all relevant actions.
In there I changed the permissions for filesystem-mount,luks-unlock,unmount-others,drive-eject,drive-detach and change all to yes. Now the USB drive automounts without any problems. No external tools like udiskie or gvfs are needed now, pcmanfm just handles it all :)

lerner
Posts: 510
Joined: Sun Mar 29, 2015 12:12 am

Re: [SOLVED] USB stick authorization error

Sun Jul 31, 2016 9:29 pm

Thank you so much!

This happened to me and I was totally stuck.

I found the errors/messages in the log files and searched for the "URL" (org.disk.....) and found your post.

I am still a bit confused about all the other things you changed.
In there I changed the permissions for filesystem-mount,luks-unlock,unmount-others,drive-eject,drive-detach and change all to yes. Now the USB drive automounts without any problems. No external tools like udiskie or gvfs are needed now, pcmanfm just handles it all :)
That is still beyond me, but I am working on it.

Return to “Arch”