Trying out Linode for the first time, running an Arch Linux image, I successfully installed nginx as root.
This, however, made /usr/share/nginx/html
inaccessible to non-root users.
Intuitively, I thought this would work:
newgrp www
(create a new group)chgrp -R www /usr/share/nginx/html
(associate directory recursively with new group)chmod -R g=rw /usr/share/nginx/html
(give read-write permissions to new group)usermod -a -G www john.doe
(add non-root user to new group)
However, I still could not write files to /usr/share/nginx/html
as john.doe. I also tried
chown -R :www /usr/share/nginx/html
to see if it had any effect—it didn't.
Here's what the setup looks like currently:
[john.doe@hydrogen nginx]$ ls -l
total 4
drwxrw-r-x 4 root www 4096 Dec 19 08:10 html
[john.doe@hydrogen nginx]$ id
uid=1000(john.doe) gid=100(users) groups=100(users),10(wheel)
[john.doe@hydrogen nginx]$ groups john.doe
wheel www users
What am I misunderstanding / missing that I can't write to this directory?
id
says you'rejohn.doe
, but you rangroups acheong87
. These aren't the same user. – phemmer Dec 19 '13 at 14:07html
directory. You need execute when working with directories. – phemmer Dec 19 '13 at 14:09root
. Thank you. – Andrew Cheong Dec 19 '13 at 14:14