Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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