2

How do I authorise my non-root user to manually mount/unmount ALL media on my desktop. I always get denied permission.

Media refers to all mountable USB devices and other partitions on my HDD as well.

ptrcao
  • 5,635
  • You become root. – rozcietrzewiacz Oct 01 '11 at 22:56
  • (Or if it is (hopefully) not what you want, think it over and describe once again, what type of media you want to be allowed to mount.) – rozcietrzewiacz Oct 01 '11 at 22:58
  • 1
    @roz: I interpreted “myself” as “my (non-root) user”, and “media” as “removable medias”. ptrcao, could you confirm this and maybe improve your post? – Stéphane Gimenez Oct 01 '11 at 23:18
  • @rozcietrzewiacz - sorry if I wasn't clear. Stéphane's interpretation is correct, except I would extend "media" to include other partitions on the same HDD as root as well as USB devices. – ptrcao Oct 02 '11 at 04:06

2 Answers2

3

Pmount is the command-line tool that I always recommend. It is a policy-based mounting program that does not require any sudo. It is useful especially for media such as USB disks, because, by default, it recognizes removable media and allows normal users to mount them. You can also extend its functionality to devices whitelisted in a configuration file.

For suggestions on automated mounting solutions, have look at this question.

2

have you tried adding the 'user' key to the options portion of the relevant lines in /etc/fstab?

/dev/cdrom      /mnt/cdrom  iso9660         noauto,ro,user  0  0

that would allow regular users to be able to mount cds or dvds.

just add similar lines for your thumbdrives or USB disks. arg1 can be a UUID too, if you have multiple devices of the same type with different filesystems.

Tim Kennedy
  • 19,697
  • 1
    Thanks Tim, unfortunately, this approach is too tedious. I am not able to anticipate and add every possible USB device. Also, the /dev/... location varies drastically and changes every time I insert a new USB device. I just want a sweeping solution that automatically grants permissions and mounts everything in a plug-and-play fashion... – ptrcao Oct 02 '11 at 04:09
  • @ptrcao You will find a variety of items under /dev/disk that you may want to take a look at. Combine this with automount and I think you will have what you are looking for. – Kevin M Oct 02 '11 at 23:03