Advertisement
man

polkit rule

man
Jan 11th, 2018
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. polkit.addRule(function(action, subject) {
  2. if (action.id == "org.freedesktop.udisks2.filesystem-mount-system") {
  3. return polkit.Result.YES;
  4. }
  5. });
  6.  
  7. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------------------------- put at bottom 50-default.rules under /etc/polkit
  8.  
  9.  
  10.  
  11. ============
  12. permission disks
  13. =============
  14. sudo chmod -R -v 777 *
  15. ==============
  16.  
  17. Make this polkit rule in /etc/polkit-1/rules.d/00-mount-internal.rules:
  18.  
  19. polkit.addRule(function(action, subject) {
  20. if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" &&
  21. subject.local && subject.active && subject.isInGroup("storage")))
  22. {
  23. return polkit.Result.YES;
  24. }
  25. });
  26.  
  27. And add your user to storage group:
  28.  
  29. # usermod -aG storage username
  30.  
  31.  
  32.  
  33. ___________
  34. ntfs-3g
  35. gvfs
  36. __________
  37.  
  38. debian
  39.  
  40.  
  41.  
  42. #/etc/polkit-1/localauthority/50-local.d/automount.pkla
  43. [Allow Automount]
  44. Identity=unix-group:plugdev
  45. Action=org.freedesktop.udisks2.filesystem-mount*
  46. ResultAny=yes
  47. ResultInactive=yes
  48. ResultActive=yes
  49.  
  50. [Allow Eject]
  51. Identity=unix-group:plugdev
  52. Action=org.freedesktop.udisks2.eject-media*
  53. ResultAny=yes
  54. ResultInactive=yes
  55. ResultActive=yes
  56.  
  57. [Allow Mounting of fstab]
  58. Identity=unix-group:plugdev
  59. Action=org.freedesktop.udisks2.filesystem-fstab*
  60. ResultAny=yes
  61. ResultInactive=yes
  62. ResultActive=yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement