1833898 Members
1932 Online
110063 Solutions
New Discussion

File Permission

 
SOLVED
Go to solution
Andi Rigauer
Regular Advisor

File Permission

Hi All,

I'm not kidding you I ask this really serious.
I have a file belong to user1:group1 with the perm 700. Now I want to grant readrights to user2:group2 and I don't wanna change the File permission itself.
Ok I know this doesn't make sense at all, but maybe you know a solution how to do this.

Brgds
NAdi
god, root where's the difference
7 REPLIES 7
Robert-Jan Goossens
Honored Contributor

Re: File Permission

Hi Nadi,

sudo ?

Regards,
Robert-Jan
Jean-Louis Phelix
Honored Contributor

Re: File Permission

Hi,

I don't think it's possible using standard permissions. You should rather look at ACLs (Access Control Lists). See man 5 acl.

Regards
It works for me (© Bill McNAMARA ...)
Jean-Louis Phelix
Honored Contributor

Re: File Permission

Hi,

Listtle mistake ... man 5 acl concerns hfs acls. If vxfs, have a look to man 1 setacl (or getacl).

Regards.
It works for me (© Bill McNAMARA ...)
Andi Rigauer
Regular Advisor

Re: File Permission

Ok ACL sounds good, maybe you can tell me more about it.
For instance I want that all files created in this directory are readable by everyone

Thanks
god, root where's the difference
Mark Grant
Honored Contributor

Re: File Permission

I thought it might be worth pointing out something about ACL's here. Some backup software does not backup ACL information and I believe "tar" is one of those
Never preceed any demonstration with anything more predictive than "watch this"
Jean-Louis Phelix
Honored Contributor
Solution

Re: File Permission

Andi,

You can simply use in your case

setacl user:user2:r-- file

and check with

getacl file

But Mark is right. There are some limitations also with NFS for example.

Regards.
It works for me (© Bill McNAMARA ...)
Bruno Ganino
Honored Contributor

Re: File Permission

If suggestion of Jean-luis is right, you must check use of "chacl" for settings permission and "lsacl" for display it.

The command "chacl" is overlapped to command "chmod" and chacl adds permission specific to permission of "chmod".

If you use "chacl", you must use "chmod" with option "-A".

HTH
Bruno
Torino (Turin) +2H