Policykit and permission for user to mount

Hello, how should I set a policy that user can use command mount?

I guess the rules should be set in etc/polkit-default-privs.local.

I have tried to put:


[Password-less mounting of local partitions]
Identity=unix-users:*
Action=org.freedesktop.udisks2.filesystem-mount-system
ResultAny=yes
ResultInactive=yes
ResultActive=yes

But no effect.

Thank you.

Martin

You need to edit /etc/polkit-default-privs.local with the following format

# Format:
# <privilege> <any>:<inactive>:<active>
#
org.freedesktop.udisks2.filesystem-mount-system auh_admin:auth_admin:yes

or if you really want to relax the restrictions (it is your system)

org.freedesktop.udisks2.filesystem-mount-system yes:yes:ye

then run

set_polkit_default_privs
  • Note that polkit is used for graphical environments. The mount command does not use this framework.