Are you aware that user3 and user4 won't be able to list any files in the folder?
Main Topics
Browse All TopicsI want to give a access permission for 4 users for the same folder (Foler Name: source_code) with different access rights in linux.
I want to give access rights for a folder in GUI mode and in command line mode.
for user1 = read and execute
for user2 = read, write and execute.
for user3 = read only.
for user4 = read only.
Any Help?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Well this requires acl
(access control list ) concept as we are using different access controls on a particular directory or folder:
1. mount the filesystem with acl parameter so that acls can be executed
mount -t ext3 -o acl devicename mountpoint/partition
2. make entry in fstab for persistance during boot times
eg. LABEL=/work /work ext3 acl 1 2
3. get the acl parameters to check from folder
getfacl foldername
4. set acl on it acc. to contitions above
setfacl -m u:user1:r-x foldername
setfacl -m u:user2:rwx foldername
setfacl -m u:user3:r-- foldername
setfacl -m u:user4:-- foldername
5. verify all by seeing all control contexts by
getfacl fodlername
follow above & lemm know if thrs still any issue with the above.
ACLs may still be needed (if you do not wish to tweak permissions of the parent directory), because it is implicit that there are user6, user7, and user8 may exist who should have no access at all. Granting world read access is probably unacceptable from a security standpoint.
The information must be confidential, and there may be other users of the system, otherwise "user3" and "user4" would not be listed as the only users that have read-only access.
There are two issues here:
* What permissions and ownerships to set on the folder
* What permissions and ownerships to set on files in the folder
It's actually not very useful to give a user "read" permission to a directory but not "execute".
The reason is without "execute" permission to a directory, you can't do anything with it.
In fact, you cannot CD into the directory or read any file from it without execute permission.
If you want to restrict the ability to execute a file, you have to use file permissions (not folder permissions)
With ACLs you _can_ set the default permissions for new files in the folder.
You can specify (for instance)
(First apply ACLs to the files)
setfacl -R -m group:firstgroup:rwx (foldername)
setfacl -R -m group:secondgroup:r-x (foldername)
setfacl -R -m group:thirdgroup:r-- (foldername)
(Then apply ACLs to the folder)
setfacl -m default:group:firstgroup:r
mask:---
group:firstgroup:rwx
group:secondgroup:r-x
group:thirdgroup:r-x
defaut:group:firstgroup:rw
default:group:secondgroup:
default:group:thirdgroup:r
'default' pertains to the initial permissions that new files get when you create them
Business Accounts
Answer for Membership
by: BlazPosted on 2008-06-13 at 04:13:33ID: 21777631
File permisions in linux are for three groups of users: rights for the owner, rights for the group andrights for all users.
Your case can be easily implemented by this scheme if you say that ALL users have read access (and all users include user3 and user4).
So:
Chmod 754 *
Chown user2:user1group *
Provided that you have a group named user1group in which there is only the user user1.