Home
PHP
Tech Tube
MySQL
Linux
CSS&HTML
JavaScript

Allow user to edit /var/www

Allow another user to edit a directory in www-data group. The post will be useful when editing files on your local /var/www/ directory. Add user samuil to group www-data:
sudo usermod -a -G www-data samuil
Add user www-data to group samuil:
sudo usermod -a -G samuil www-data
List all users in www-data and samuil groups to be sure that the user is added:
awk -F':' '/www-data/{print $4}' /etc/group
Make sure that the desired directory has the required permisions for the group:
sudo chmod 775 -R /var/www/
Login again to make sure that your user permitions will apply for samuil:
su samuil
Restart your HTTP server to ensure that www-data user has applied permisions:
sudo /etc/init.d/apache2 restart