[Gllug] sharing folders between users

Richard Jones rich at annexia.org
Wed Feb 17 16:50:32 UTC 2010


On Wed, Feb 17, 2010 at 04:40:41PM +0000, Justin Perreault wrote:
> I am wanting to share files between two users on one machine. It does
> not make sense to me that I would need to install smb to do that.
> 
> I have tried setting up an extra user adding the real users to its
> group. 

You only need to create a new group and add each user to it.  The
following commands should work (as root):

groupadd shared
usermod -a -G shared user1
usermod -a -G shared user2

Now create the new shared directory somewhere which is in the shared
group, eg:

mkdir /home/shared
chown root.shared /home/shared
chmod ug+w,o-w /home/shared

The users may need to log out and log in.  Use the 'id' command to
prove that the users are members of the new group 'shared':

$ id
uid=500(user1) gid=500(user1) groups=499(shared),500(user1)

They should be able to read and write files in the /home/shared
directory.

Rich.

-- 
Richard Jones
Red Hat
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list