Amazon AWS Filezilla transfer permission denied

Amazon Web-ServicesAmazon S3Amazon Ec2Webserver

Amazon Web-Services Problem Overview


I have my instance of the Amazon AWS running, test page is up.

I am trying to SFTP the files to the server to display my website. I have Filezilla connected to the AWS server but when I try to move the files from my local machine to the /var/www/html directory, it says permission denied.

I just figured out I CAN move the files to the /home/ec2-user directory. So my files are on the server I guess. But when I try to move them from there to the /var/www/html directory, it still won't move them, permission denied.

I've been researching this for approximately 2 hours now but I haven't been able to locate the answer to this.

Any help is greatly appreciated, i'm so close! Haha

Thanks

UPDATE

enter image description here

Amazon Web-Services Solutions


Solution 1 - Amazon Web-Services

To allow user ec2-user (Amazon AWS) write access to the public web directory (/var/www/html),
enter this command via Putty or Terminal, as the root user sudo:

chown -R ec2-user /var/www/html

Make sure permissions on that entire folder were correct:

chmod -R 755 /var/www/html

Doc's:

Setting up amazon ec2-instances

Connect to Amazon EC2 file directory using Filezilla and SFTP (Video)

Understanding and Using File Permissions

Solution 2 - Amazon Web-Services

if you are using centOs then use

sudo chown -R centos:centos /var/www/html

sudo chmod -R 755 /var/www/html

For Ubuntu

sudo chown -R ubuntu:ubuntu /var/www/html

sudo chmod -R 755 /var/www/html

For Amazon ami

sudo chown -R ec2-user:ec2-user /var/www/html

sudo chmod -R 755 /var/www/html

Solution 3 - Amazon Web-Services

In my case the /var/www/html in not a directory but a symbolic link to the /var/app/current, so you should change the real directoy ie /var/app/current:

sudo chown -R ec2-user /var/app/current
sudo chmod -R 755 /var/app/current

I hope this save some of your times :)

Solution 4 - Amazon Web-Services

If you're using Ubuntu then use the following:

sudo chown -R ubuntu /var/www/html

sudo chmod -R 755 /var/www/html

Solution 5 - Amazon Web-Services

This work best everyone

chmod ugo+rwx your-folder

https://help.ubuntu.com/community/FilePermissions

Solution 6 - Amazon Web-Services

In my case, after 30 minutes changing permissions, got into account that the XLSX file I was trying to transfer was still open in Excel.

Solution 7 - Amazon Web-Services

for me below worked:

chown -R ftpusername /var/app/current

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionzburns12View Question on Stackoverflow
Solution 1 - Amazon Web-ServicesBlack SheepView Answer on Stackoverflow
Solution 2 - Amazon Web-ServicesAbhay KocharView Answer on Stackoverflow
Solution 3 - Amazon Web-ServicesOskarView Answer on Stackoverflow
Solution 4 - Amazon Web-ServicesRaymond WachagaView Answer on Stackoverflow
Solution 5 - Amazon Web-ServicesAdeleye AyodejiView Answer on Stackoverflow
Solution 6 - Amazon Web-ServicesikleimanView Answer on Stackoverflow
Solution 7 - Amazon Web-ServicesRavistmView Answer on Stackoverflow