[wplug] sharing files with another user

Poyner, Brandon bpoyner at ccac.edu
Mon Aug 16 09:01:16 EDT 2004


Yes, there is a way, assuming here that you have a modern POSIX system
that supports filesystem access control lists (ACL).  You should be able
to do this with FreeBSD 5.x, most newer Linux distributions like Fedora
Core, and Solaris, not sure what else.  Taking the example of Linux
you'll have to mount the file system with the acl mount option.

/dev/mapper/sys-tmp on /tmp type ext3 (rw,nosuid,nodev,acl)

$ touch /tmp/x
$ chmod 600 /tmp/x
$ ls -la /tmp/x
-rw-------  1 bpoyner bpoyner 0 Aug 16 08:55 /tmp/x
$ setfacl -m u:nobody:r /tmp/x
$ ls -l /tmp/x
-rw-r-----+ 1 bpoyner bpoyner 0 Aug 16 08:59 /tmp/x
$ getfacl /tmp/x
getfacl: Removing leading '/' from absolute path names
# file: tmp/x
# owner: bpoyner
# group: bpoyner
user::rw-
user:nobody:r--
group::---
mask::r--
other::---

Brandon Poyner
Network Engineer II
CCAC - College Office
412-237-3086


-----Original Message-----
From: Brandon Kuczenski [mailto:brandon at 301south.net] 
Sent: Monday, August 16, 2004 3:36 AM
To: WPLUG
Subject: [wplug] sharing files with another user


What is the best way to make a certain file on a POSIX system readable
by
one other user?

I've thought about this a little, and can't come up with a way to do it
without involving root (editing, at the very least, /etc/group).  I am
running a system on which each user has his/her own group, and so by
adding the 'privileged' user to the owner's group, the owner can then
share selected files with the 'privileged' user.  But that requires
asking
root to help, which seems nonideal.

-Brandon

_______________________________________________
wplug mailing list
wplug at wplug.org
http://www.wplug.org/mailman/listinfo/wplug




More information about the wplug mailing list