1

This question already has an answer here:

I'm attempting to cat a file with 770 permissions as a user who is part of the group (but not the owner of the file). This should provide sufficient permissions to my understanding, yet I encounter a Permission denied nevertheless. What am I missing?

[altay@arch ~]$ ls -l test.txt 
-rwxrwx--- 1 http http 24 Sep 15 18:56 test.txt
[altay@arch ~]$ groups altay 
lp wheel http network video audio storage autologin users
[altay@arch ~]$ cat test.txt 
cat: test.txt: Permission denied
[altay@arch ~]$ sudo cat test.txt 
I am not readable by my group despite 770 permissions.

marked as duplicate by Gilles, roaima, Anthon, Community Sep 16 '15 at 23:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Did you recently add yourself to one of those groups? If so you'll need to restart your login session before it takes effect, alternately do you have selinux running? – Eric Renouf Sep 16 '15 at 3:43
  • That's exactly what happened. I didn't realize changes to groups wouldn't take effect immediately. If you want to post your comment as an answer I'll accept it. – Altay_H Sep 16 '15 at 13:17
  • Run groups with no argument to see what groups the current process is in. – Gilles Sep 16 '15 at 22:11
1

After adding yourself to a group you need to restart your shell for it to notice that change. Otherwise the shell will only act as though you're in the groups that you were in when it started

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