Question

How I edit index.html? My droplet is Ubuntu LAMP on 14.04

  • Posted November 14, 2014

I just created a droplet Ubuntu LAMP on 14.04. I am trying to change index.html via filezilla in sftp://miusuario@mydomian.co/var/www/html/index.html Howevere, when I upload my index.hmtl I get the error Error: /var/www/html/index.html: open for write: permission denied. I am following this tutorial: https://www.digitalocean.com/community/tutorials/how-to-use-filezilla-to-transfer-and-manage-files-securely-on-your-vps and everything worked fine until this point. What should I do? I also granted the permissions to “miusuario” suggested in this Tutorial: https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-12-04 so I added the lines in visudo:

miusuario ALL=(ALL:ALL) ALL

Thanks in advance

Subscribe
Share

I am using WINSCP to edit files in var/www/html, and am having a similar problem (I can edit index.html, but am denied permission to save it). I tried the same three sudo commands you show, and this partially solved the problem. The part of the problem that was solved is that the file was uploaded successfully, with the minor change I made. However, WINSCP still says '… but error occurred while setting the permissions and/or timestamp." Is there an additional ‘sudo’ command that might solve this problem?

This comment has been deleted


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

If you want to be able to edit the file directly using Filezilla over SFTP, you’ll need to add your user to the www-data group and allow all members of that group to edit files. Run:

sudo usermod -a -G www-data foo
sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R g+rw /var/www/html/

If you want to be able to edit the file directly using Filezilla over SFTP, you’ll need to add your user to the www-data group and allow all members of that group to edit files. Run:

sudo usermod -a -G www-data foo
sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R g+rw /var/www/html/