N
N
Nikolay2019-06-20 15:35:43
Debian
Nikolay, 2019-06-20 15:35:43

Why can't I create a folder even though I'm in a group?

Good day!
I set up the server (Debian 9), created a folder /var/www/, assigned the owner along with the group www-data
Problem:

/var/www/$mkdir anotherdir
mkdir: cannot create directory ‘anotherdir’: Permission denied

Although:
/var/www$ls -l
drwxrw-r-x 4 www-data www-data 4096 Jun 20 14:39 somedir

/var$ls -l
...
drwxrwxr-x  3 www-data www-data 4096 Jun 20 14:39 www

/var/www$groups username
username : username sudo www-data

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2019-06-20
@iNickolay

If you have just added a user to a group, then the already logged in user has not yet been included in this group.
to test write
id
will show your uid, gid and a list of additional groups.
Most likely just re-login and try to create a folder.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question