Sharing directories across the LAN

Kenneth P. Turvey kt-usenet at squeakydolphin.com
Tue Oct 23 17:41:02 UTC 2007


On Tue, 23 Oct 2007 13:35:17 -0300, Derek Broughton wrote:

[Snip]
> The problem I'm running into is with making all files modifiable by both
> users.  If the folder has the guid bit set, and we're both in the group,
> then all files get created with the same group - so far so good.  However,
> by default files are generally not created with group write permission, and
> I don't really want to change that globally.

This really is how you do this usually.  You just make the directory you
want to share SGID to the group that you are both in.  Then you make sure
that your umasks are both set with group write Ok.  

Normally each user has their own personal group as well.  This way you
aren't really giving away any access when you create a file under your
home directory.  

So If I'm johnsmith, there would also be a group called johnsmith that
would be my default group.  So when I create files under my home directory
they would be something like this:

-rw-rw---- 1 	johnsmith	johnsmith 	myfile   

by default.  

If you look, your Ubuntu distribution works this way by default.  

So all you need to do is:

1) Create a new group, maybe family
2) Add you and your wife to the new group
3) Change your umask to be 002 or something similar. (probably in .profile
or .bashrc or somewhere so it will be set by default). 
4) Create a directory to share
5) chgrp family new_directory
6) chmod g+rwS new_directory 

There, now you can share files in the directory fairly transparently.  

This all breaks if you don't set the umask correctly by default.  You'll
end up with files being created that you can't read and such.



-- 
Kenneth P. Turvey <kt-usenet at squeakydolphin.com>





More information about the ubuntu-users mailing list