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.
  • 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 'SO- stop being evil' Sep 16 '15 at 22:11

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

| improve this answer | |

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