7

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

6

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .