Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

in linux,

if a user belongs to 2 groups. 1 group gives the user access to a file (say read) the other group doesn't allow them access.

Is there a way to deny access to a file EVEN if a group the user belongs to is giving him read access?

share|improve this question

4 Answers 4

The normal way to do this would be to create two groups, one which said user is a member of, and one which that user isn't, and assign the groups accordingly.

share|improve this answer

This isn't possible with built-in Linux permissions.

POSIX ACL, on Linux, doesn't allow this either.

share|improve this answer

File permissions have only one group-id field. Which means the file can be accessed if the user belongs to that group. Other belongings do not affect it.

share|improve this answer

Last I knew this wasn't possible.

If the user shouldn't have access, then the user shouldn't belong to that group / role or the group / role shouldn't have access.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.