I am running an instance of Ubuntu on Amazon Web Services, all working pretty dandy. I've got one little snag that i'm trying to find the answer to atm.

Amazon forces you to have another user other than root. And thus you cannot connect as root. So in I go with my username via ssh and sftp, works v well.

However, I cannot edit anything unless explicitly giving the file chmod 777 rights.

Now I am quite clear as to what the problem is, just not the solution. My user second user, logs into his/her home directory just fine. But my apache install and files are located at /var/www

Could I solve this by symlinks in the home directory etc or is there a way I can setup the permissions for this user to access and write to the /var/www folder and all files within it, without also giving that right to the general public?

Any help would be much appreciated.

1 Answer 1


In the specific case of files for a web server, it's ok to simply give ownership of that directory to the ubuntu user.

 sudo chown -R ubuntu:ubuntu /var/www

Then you can drop files there easily.

You might also find some useful information about the EC2 user setup on Ubuntu in this article I wrote a while back:

Using sudo, ssh, rsync on the Official Ubuntu Images for EC2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.