Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Linux/User Access To Web Root

May 16, 2013

User Access To Web Root

When setting up your Ubuntu server, you can allow regular Linux accounts to access your web root directory via FTP or secure shell. In this case, you want users to access /var/www directory. One of the first things you’ll need to do is give permissions to the Apache user www-data.

Change the group name to /var/www.

sudo chgrp www-data /var/www

sudo chgrp www-data /var/www

Make it writeable.

sudo chmod 775 /var/www

sudo chmod 775 /var/www

Set the GID for www-data for all sub-folders.

sudo chmod g+s /var/www

sudo chmod g+s /var/www

Finally, add your user to www-data group.

sudo usermod -a -G www-data username

sudo usermod -a -G www-data username

This will now allow you to use a regular user account via FTP or SSH with write permissions to the /var/www directory. This is much more secure way than using the www-data user account.

Filed Under: Linux Tagged With: apache

Have content delivered to your mail. Subscribe below.

About Me

I'm Ulysses, Cloud Engineer at Cardinal Health based in Columbus. This blog is about Linux and Cloud technology. When off the grid, I enjoy riding the electric skateboard. I've surfed, snowboarded and played the saxophone in the past. I hope you will find this website helpful. It's powered by WordPress and hosted on AWS LightSail.

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021