Polkit

Iš Žinynas.
(Nukreipta iš Policykit)
Jump to navigation Jump to search

Visu nustatymu overridinimas (kad galima butu paprastam vartotojui pilnai administruoti sistema)[keisti]

cd /usr/share/polkit-1/actions

Pasirinktinai pagal saugumo polisus renkames faila ir keiciam jo turini:

sudo sed -i "s/auth_admin_keep/yes/g" /usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy

Disku montavimas su udisks2[keisti]

Isdebugint kodel nemountina galima paleidus udisksctl mount komanda, nurodzius irengini, pries tai paziurejus kokiu mountinamu irenginiu turime:

udisksctl dump|awk -F':\n' -v'RS=\n\n' '/[ \t]*HintAuto:[ \t]*true/&&/\.Filesystem:/{sub(/.*\/UDisks2\//,"",$1); print $1}'

Mountinam:

udisksctl mount -p block_devices/sdc1

Jeigu mums parodys kazka panasaus i:

==== AUTHENTICATING FOR org.freedesktop.udisks2.filesystem-mount-other-seat ===
Authentication is required to mount General USB Flash Disk (/dev/sdc1)
Authenticating as: vartotojas

Atsidarius faila /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy randame sia eilute:

org.freedesktop.udisks2.filesystem-mount-other-seat

Apacioje matome:

   <defaults>
     <allow_any>auth_admin</allow_any>
     <allow_inactive>auth_admin</allow_inactive>
     <allow_active>auth_admin_keep</allow_active>
   </defaults>

Keiciame i:

   <defaults>
     <allow_any>yes</allow_any>
     <allow_inactive>yes</allow_inactive>
     <allow_active>yes</allow_active>
   </defaults>

Uzmountinti visus diskus automatiskai[keisti]

Scriptas:

 #!/bin/sh
 udisksctl dump |
  awk -F':\n' -v'RS=\n\n' '/[ \t]*HintAuto:[ \t]*true/&&/\.Filesystem:/{
                             print $1
                           }' |
  while read dev
  do
    udisksctl mount --object-path "${dev##*/UDisks2/}"
  done

Kitu montavimo problemu sprendimas[keisti]

/usr/share/polkit-1/actions/org.freedesktop.udisks.policy

<action id="org.freedesktop.udisks2.filesystem-mount">
...
<allow_any>yes</allow_any>
...
<allow_active>yes</allow_active>
</action>

/usr/share/polkit-1/actions/org.freedesktop.udisks2.policy

Eilutes:

 <action id="org.freedesktop.udisks2.filesystem-mount">
   <defaults>
     <allow_any>auth_admin</allow_any>
     <allow_inactive>auth_admin</allow_inactive>
     <allow_active>yes</allow_active>
   </defaults>
 </action>

Pakeiciam i:

<action id="org.freedesktop.udisks2.filesystem-mount">
   <defaults>
     <allow_any>yes</allow_any>
     <allow_inactive>yes</allow_inactive>
     <allow_active>yes</allow_active>
   </defaults>
 </action>

Paleidziam:

sudo pam-auth-update --force