Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

is there a way of sharing an ext3/ext4 formatted partition on an external USB drive between different users (uids) on different Linux machines without creating a group for this purpose, setting the group ownership of the partition to this group and adding each respective user to the group on every machine?

This would mean that I need to have root privileges on every machine... which I may not have in some cases.

I'm using the partition to store the code I'm developing on Linux and I would like the option to be safe... if possible.

I could use a vfat partition but then I have no control of the rw rights + I cannot develop directly in the dir: I would always have to tar.gz the directory, extract, work, tar.gz, copy to the external drive... and so on.


share|improve this question
Please clarify, are you trying to restrict read/write permissions when the device is mounted on other machines? – TiCL Aug 30 '11 at 15:19
up vote 1 down vote accepted

If I understood you right, you know that linux stores the permissions on a UID / GID identification. When you connect it to another computer (I imagine that not in a shared way, but like a Flashdrive that you remove from one computer and connects on another), the linux does the following:

  1. "oh, I have a new drive. The specific file blablabla have uid = 223, gid = 221"

  2. "The user john_doe here have a uid = 223. Hey, that's a match! So the file blablabla is owned by john_doe"

So, as long as you have the same uid and gid in different computers, the ext. drive will be mount with the name = uid relation according to the local linux machine.

Ok, so you know how to do it: configure your user to have the same uid in every computer.

And that doesn't solve your problem: security based in external drives permission and uid will be very easily circunvented. For example: I take your drive, mount it in my linux box, where I'm the root. I access everything, read, write...

share|improve this answer
Thanks! This is what I thought of as well, the only problem is then if I share the drive between different users with different IDs (my coworkers for example), and in the case where I don't have the root privileges, and I cannot change the uid or create new user groups. So, basically, is it not then simpler to use vfat formatted external drive even for sharing between linux machines (different uids, no groups assumed), in a complete general sense? – tmaric Sep 1 '11 at 8:10
Yes, much easier using VFat. But security is gone. I thought you were worried about security (that involves much more than simple read - write permissions). If your problem is just sharing it, using Vfat will make it a lot easier. – woliveirajr Sep 1 '11 at 11:57

if they use the same type of distro, you can use some common group IDs.

for example for debian based distro, you can use audio (29) group, or plugdev (46) you can observe the groups on the clients machines (cat /etc/groups - no need for root access) and see the group with biggest membership base

share|improve this answer
Thaks a lot! See my comment above... I'll use groups and uids for my own computers and have my own ext4 partition on the drive, so this is very helpful, but for general purpose use, I think I may have to have a vfat/ntfs partition on the usb drive, if I want to share data with other people and work on machines on which I have no root privs. – tmaric Sep 1 '11 at 8:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .