There is one user Lets call him B and he needs access Just to Read the File MEANS READ ACCESS and that file is own by another user A .
How can I grant access to user A's file to User B.
Standard UNIX permissions aren't quite that granular. You either need to,
For #1, if this is the only file you care about, create a group called readerb, put user B into it, and change the group ownership on the file (
To do #2 you need to make sure your distribution supports ACL's, you have the ACL utilities installed, and your filesystems are mounted with ACL support.
With that in place, you would use,
to give user B access to
[*] technically user A and B don't need to be in the same group, you could just put user B into the group, or use a group user B is currently the only member of.
you can give 444 permissions to the file that the user wants to access...the command will be chmod 444 /filename/ want to apply recursively and forcely you can try chmod -Rf 444 /filename/.
Correct me if I am wrong, but couldn't he also issue a
That is, assuming he is the user that owns the file, and wants someone who does not belong to the same groups that he belongs to read the file contents.