Permission errors on web server
Im getting the classic permission error after I setup a new apache server on debian 9.3
I was trying to append the index.html file by doing:
sudo echo 'hello world, etc' >> /var/www/html/index.html
but it is returning as permission denied. I am doing this under my user account and not under root or www-data. I can do everything else with sudo including move files into the /var/www/html directory and change their permissions
My permissions are:
/var/www/
drwxr-xr-x 2 www-data www-data 4.0K Mar 23 11:41 html
/var/www/html
xr-x 1 www-data www-data 11K Mar 23 11:22 index.html
Posted Mar 23, 2018, 5:50 PM UTC
sudo echo 'hello world, etc' >> /var/www/html/index.htmlThe redirection is handled by the shell (running as user) and not by the echo command.