isolate usb-memorysticks

July 31st, 2010 - 04:14 am ET by gd | Report spam
Hi all,

I have the following problem :
- When a user put in a usb-stick in example port 4 in a usb-hub, I want
only user1 can see and can mount these usb-memorystick.
- When a other user put in a usb-stick in a other port example port 3 in
these usb-hub, only user 2 can see and can mount these usb-memorystick, ...

How can I do this?
It's for use with a multiseatcomputer in a library.

I use ubuntu 10.04 for OS.

I have fixed already the following, when I put a memorystick everyone
can see it and write to it.
Or a other solution : when I put in a memorystick, only the person who
have mount the stick can see and write to it.
But that's not good enough, when person1 put in the stick, and person 2
mount the stick very fast, person2 can see and write and not the right
person (person1).

I'm thinking how I can fix this:
- usb port 4 - automaticly mount to /media/usb4
- only user1 has rights to see and write to /media/usb4

But how can I do this ?
- Can ubuntu linux see on wath usb-port the stick is ?
- Can I set rights to the folder /media/usb4 that only user1 can see and
write it? It must only user1 that can see the items also !

Thanks for help to a solution.

gd
email Follow the discussionReplies 1 replyReplies Make a reply

Similar topics

Replies

#1 felix
August 06th, 2010 - 03:02 am ET | Report spam
Hi,

not a solution, but some little hints:

* gd :
- Can ubuntu linux see on wath usb-port the stick is ?



You can take a look at the device links in /dev/disk/by-path/

- Can I set rights to the folder /media/usb4 that only user1 can see and
write it? It must only user1 that can see the items also !



When mounting, the mount options, and access rights on the mounted
filesystem (if any) are used. When using USB sticks with vfat or ntfs
filesystems, you can make sure only the user who mounts it gets access
by setting the umask mount option accordingly.

To make sure only one user CAN mount, the device node itself should have
the correct permissions. This can probably be done by writing custom
udev rules. For example, if I do an "udevadm info --attribute-walk
I get some output for the USB port:

| [...]
| looking at parent device '/devices/pci0000:00/0000:00:0b.1/usb1/1-5':
| [...]
| ATTRS{busnum}=="1"
| ATTRS{devnum}=="5"
| ATTRS{devpath}=="5"

You could probably use these to match devices on a single USB port.

Felix Palmen (Zirias) + [PGP] Felix Palmen
web: http://palmen-it.de/ | http://palmen-it.de/pub.txt
my open source projects: | Fingerprint: ED9B 62D0 BE39 32F9 2488
http://palmen-it.de/?pg=pro + 5D0C 8177 9D80 5ECF F683
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search