linux – I don't have permission to read the file even though I'm in the file owner's group

Question:

For example, there is a 1.png file.

It is owned and grouped by www-data:www-data . The file has permissions -rw-rw----

As I understand it, the owner and everyone in the owner's group can view the file, i.e. in the www-data group.

My user is andrey . I added it to the www-data group with $ sudo usermod -a -G www-data andrey . If you look it up with the $ groups andrey command, then the www-data group is in the list.

But for some reason, there is still no right to view this file. Those. i can't open this picture in ubuntu 16.04 in normal explorer. Why is this happening? Or am I misunderstanding the mechanism of access rights? Tell me please.

Answer:

You need to relogin for the changes to take effect.

Scroll to Top