Genius.
rgh.


YoYo Siska wrote:

Qiangning Hong wrote:


I have a file with special permission requirement.  I want user1 and
user2 can read/write this file, user3 can read only and others can not
access it.  How to set the permission bits?  No ACL support.



undoable with standard acces rights in linux :(
you could create a group for user1 and user2 (say group12), then set the
owner to user3, but he as an owner can  change the permissions to
enable write...

if you can afford to create a special directory and put the file under
it, you can do it in this way:

create a directory with owner root, group set to a group that contains
all 3 users and the rights set to 750 (read and execute for group, no
execute for others)

only users 1,2,3 (and root ;) can acces anything under this directory

now create the file under this directory, owner root, group: a group
conataining only user 1&2, rights 664 (read&write for group, read for
others -- this is for user3, nobody else is able to get to this file)

this way you need 2 additional groups, one for users 1,2,3 other for
users 1,2
you could use only the second group and have user3 as the owner of the
directory, but than he would be able to delete the dir
you can still get around this by creating 2  directories, one for
group12, second for user3, hardlink the file into both directories, if
user3 deletes his dir, he just looses the acces to the file, but the
file is not lost...





-- gentoo-user@gentoo.org mailing list



Reply via email to