• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

User Access To Web Root

May 16, 2013

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

Search This Website

Subscribe Via Email

  • Home
  • About
  • Archives

Copyright © 2023