How to copy files into `/var/www` with WinSCP

amazon ec2apache-http-serverwinscp

When I try to place my web files into /var/www in apache on my ec2 Ubuntu instance it is giving me an error stating that I don't have permission.

Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 3

How do I give myself permission to do this or what is the best way to copy files to /var/www with WinSCP?

Best Answer

I was getting the same error in WinSCP. One solution is to change the ownership of the '/www/' folder using chown. That way, you can make the user you log in with into the owner instead of 'root' being owner. I am using an instance of Amazon Linux rather than Ubuntu, but this command worked for me:

sudo chown -R -v ec2-user /var/www/

The user 'ec2-user' is the user I log in with.

Potentially Useful links

Related Question