Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get permission to work with files on my Amazon EC2 Ubuntu server using FTP-WinSCP

I have an Ubuntu server on Amazon, I installed everything for working with it (php, mysql, phpmyadmin, apache..), The problem is that I cant move around or edit files using the FTP.

I get the error message:

Permission denied.
Error code: 3
Error message from server: Permission denied

from my WINSCP.

The only way I can trancefer/edit file is using 'putty' with the sudo/nano command.

I found a lot of information about this on google, but there are no updated soulution I can find. Linux isn't my usual work-space.

How do I get the permissions working for the WINSCP ?

like image 584
Imnotapotato Avatar asked Feb 01 '15 09:02

Imnotapotato


People also ask

How do I enable FTP on AWS EC2?

Sign in to your AWS console (EC2 Dashboard). Go to Instances (under “INSTANCES”) > select the checkbox of an instance for which you want to allow connections to the passive FTP port range. On the “Description” tab, next to “Security groups”, click the name of the automatically generated security group.

How do I grant permissions in WinSCP?

The Add X to directories checkbox makes WinSCP add “execute” permission to directories for every permission group (owner/group/others) where there is a “read” permission set already. On the Properties dialog, the option is available only when there is at least one directory selected.


2 Answers

A lot of answers say to change permissions on /var/www/ ... however AWS shortcuts out of the WWW folder and into the /var/app/current/ directory. If all else fails try:

sudo chown -R -v ec2-user /var/app/current/
like image 119
Keith C. Avatar answered Oct 20 '22 13:10

Keith C.


On Ubuntu image in AWS, default user is ubuntu. Instead of using system folders like /var/... better to use /home/your_folder. Then change the ownership using {chown} command. For eg.

$ sudo chown -R -v ubuntu /home/your_folder/

This will change the ownership of 'your_folder' and contents inside it from 'root' user to 'ubuntu'. Then Winscp should be able to upload/delete/create files using SFTP/FTP etc..

like image 20
userAbhi Avatar answered Oct 20 '22 12:10

userAbhi