Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer

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
http://alestic.com/2009/04/ubuntu-ec2-sudo-ssh-rsync

share|improve this answer
add comment

Your Answer

 
discard

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.