I'm new to Linux admin'ing. I created a user named webadmin
and I want to give it permission to read/write in the /var/www/html
directory.
How do I go about doing this?
I'm new to Linux admin'ing. I created a user named webadmin
and I want to give it permission to read/write in the /var/www/html
directory.
How do I go about doing this?
Personally, I would set the ownership of /var/www/html to apache. You can do this by:
chown apache /var/www/html
Next, I would create a group of let's say "Web admins":
groupadd webadmins
Add the user webadmin to the newly created group:
usermod -G webadmins webadmin
Add group permissions to the newly created group:
chmod g+rw /var/www/html
www-data:www-data
, not as apache
by default.
webadmin
needs to be in multiple groups, don't forget the -a
flag: usermod -a -G webadmins webadmin
-- and regarding @jgoldschrafe's comment, in case you want to modify only directories, sudo find . -type d -exec chmod g+s {} \;
Mar 5, 2013 at 15:22