[HOWTO] Mount devices by users without password

Here you'll find a place for solutions and hints.

Please use one of the support subforums below for questions or if you have any issues and need support.

[HOWTO] Mount devices by users without password

Postby magia » May 30th, '13, 17:00

To allow users to mount devices (e.g. another partition of internal drive) without authentication, create /etc/polkit-1/rules.d/99-allow-mount.rules with these lines:

Code: Select all
// Allow all users to mount devices without authentication
polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.filesystem-mount")) {
      return polkit.Result.YES;
   }
});
polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system")) {
      return polkit.Result.YES;
   }
});


Note: This howto is added to the Mageia Wiki.
magia
 
Posts: 3
Joined: May 30th, '13, 15:21

Re: [HOWTO] Mount devices by users without password

Postby doktor5000 » May 31st, '13, 21:13

Thanks for sharing, replaces viewtopic.php?p=5136#p5136 in my bookmarks :D
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18070
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

[SOLVED] mount and unmount usb media on xfce

Postby hman » Jun 4th, '13, 17:16

Hi all,
i had some errors using xfce4 to mount and unmount usb media. Sometimes i haven't any error message, other time i had permissions errors.
I solved creating an udev rules /etc/polkit-1/rules.d/10-drives.rules as follow:
Code: Select all
// Allow all users to mount devices without authentication
polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.filesystem-mount")) {
      return polkit.Result.YES;
   }
});

polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system")) {
      return polkit.Result.YES;
   }
});

// Allow to unmount
polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.filesystem-unmount-others")) {
      return polkit.Result.YES;
   }
});

// Allow to eject
polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.eject-media")) {
      return polkit.Result.YES;
   }
});

polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.eject-media-system")) {
      return polkit.Result.YES;
   }
});

polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.eject-media-other-seat")) {
      return polkit.Result.YES;
   }
});


bye
Armando
edit doktor5000: merged into existing thread
Blog: http://www.integrazioneweb.com/

Some projects:
- Monosim github.com/armando-basile/monosim/
- Comex-Project github.com/armando-basile/comex-project
- Sagent github.com/armando-basile/sagent
hman
 
Posts: 34
Joined: Feb 20th, '12, 11:56

Re: [HOWTO] Mount devices by users without password

Postby man-draker » Jun 10th, '13, 21:42

Under MGA3(64) I experience the same problem.
I created the proposed file. It enables Users to mount partitions on internal drives.
But USB-Sticks are not shown in Thunar.
They are recognised by the system:
Code: Select all
-- Logs begin at Mon, 2013-05-27 19:27:40 CEST. --
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] Write Protect is off
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] Mode Sense: 23 00 00 00
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] No Caching mode page present
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] Assuming drive cache: write through
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] No Caching mode page present
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] Assuming drive cache: write through
Jun 10 21:34:38 localhost kernel:  sdd: sdd1
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] No Caching mode page present
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] Assuming drive cache: write through
Jun 10 21:34:38 localhost kernel: sd 11:0:0:0: [sdd] Attached SCSI removable disk
man-draker
 
Posts: 2
Joined: Jun 2nd, '11, 22:32

Re: [HOWTO] Mount devices by users without password

Postby doktor5000 » Jun 10th, '13, 21:48

Well, if they're not shown at all, that's not the same as shown, but not mountable as user without password, no? ;)
Maybe some polkit stuff missing, or maybe thunar hasn't been updated for udisks2 "goodness" ...
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18070
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [HOWTO] Mount devices by users without password

Postby man-draker » Jun 10th, '13, 22:30

doktor5000 wrote:Well, if they're not shown at all, that's not the same as shown, but not mountable as user without password, no? ;)
Maybe some polkit stuff missing, or maybe thunar hasn't been updated for udisks2 "goodness" ...

OK I'll start a new thread in the german forum.

EDIT: Problem solved. Filesystem in USB-stick was defect.
man-draker
 
Posts: 2
Joined: Jun 2nd, '11, 22:32


Return to The magician suggests...

Who is online

Users browsing this forum: No registered users and 1 guest