enabling only one user to mount external HD

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

enabling only one user to mount external HD

Postby vincentm77 » Jan 8th, '19, 22:48

Hi everyone,

I have an external hard-drive, which i want only one user (userA) to be able to mount and to have access (read/write) to.

How can I enable the hard drive to be mounted automatically when it is plugged under a session opened by userA ?
All other users should not be able to mount and/or have any access to the HD.

usually the HD mounts to /externalHD

I have tried to edit fstab but i didn't find a solution yet.

Any help ?

Thanks
Vincent
vincentm77
 
Posts: 59
Joined: Sep 5th, '13, 16:56

Re: enabling only one user to mount external HD

Postby benmc » Jan 10th, '19, 02:27

Not something I have done, but I have certainly done the reverse ;) .

when "user A" has the device plugged in, open your file browser /manager, right click the directory for the external device, edit properties / permissions / ownership to allow only the "user A" to have read / write access.
(un)fortunately, anyone with super user access will be able to access and modify any files on that external device.
benmc
 
Posts: 1175
Joined: Sep 2nd, '11, 12:45
Location: Pirongia, New Zealand

Re: enabling only one user to mount external HD

Postby filip » Jan 17th, '19, 17:38

One workaround is to create a directory with permissions only for userA and to use that directory for all nonshareable files.
Other possible one is to use bind mount in the /home/userA/somewhere.

A part from my RPI USB HDD setup:
Code: Select all
$ cat /etc/fstab
# [Device]               [Mount Point]               [File System Type]   [Options]                     [Dump] [Pass]
# USB HDD /dev/sda1: UUID="your-UUID"
UUID=your_UUID          /mnt/with_only_root_access      ext4            defaults,noatime,nofail    0      2

# and then bind mount:
/mnt/with_only_root_access   /home/me/somewhere         none            bind,nofail                0      0

Please note the nofail option to not stop the boot.
filip
 
Posts: 474
Joined: May 4th, '11, 22:10
Location: Kranj, Slovenia


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest