1

I have made several partitions on my hard disk. One is encrypted (LUKS) and contains my sensitive data. I don't want this partition to be mounted permanently (by automounting it via fstab), only when I (or another user) need(s) it.

Problem: I can only mount these as an admin. No normal user can mount partitions on my system. A least, I don't know any other way to do this. I'm running a dual boot system (win7, Ubuntu 14.04) on a Dell Inspiron N5050.

Question: how can I let normal users mount partitions in general, and an encrypted partition in particular?

pmount is not the solution here; it only mounts external devices.

  • I don't know if you can understand it but a solution for a similar problem in terms of programming to access a private variable will be to create a public method that can access the variable. On Ubuntu, a similar approach will be to create a link to the file on that partition on a location which the other user can access. I'm still not sure if that would work for other users. Try it and I will post it as an answer if it works. – adeen-s Nov 29 '15 at 13:30
  • I'm afraid I have no idea what you're talking about, but I'm sure it's a good solution:) – MaPe Nov 29 '15 at 18:14
1

Edit your /etc/sudoers with

sudo visudo

Don't use nano, vi or something else and add the lines below

%users ALL = NOPASSWD: /bin/mount
%users ALL = NOPASSWD: /bin/umount

You still need sudo to mount and unmount your devices, but no password.

  • 1
    You can edit in (e.g.) gedit with sudo EDITOR=gedit visudo ;) – kos Nov 29 '15 at 14:05
  • I'm probably doing something wrong here. These are the steps I have taken: 1) add the exact lines (including % marks) to /etc/sudoers, 2) logged in with a normal user account. Helas, it didn't work. Just to be clear on this: I have added '%users ALL = NOPASSWD: /bin/mount' and '%users ALL = NOPASSWD: /bin/umount' to the bottom of the file. – MaPe Nov 29 '15 at 18:11
  • The error message is? – A.B. Nov 29 '15 at 18:27
  • well, it's in Dutch, but the translation is something like this: 'authentication is required to mount (for example) /dev/sda1'. – MaPe Nov 29 '15 at 18:35
  • Sorry, added an explanation to my answer. – A.B. Nov 29 '15 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.