Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install and configure FTP on amazon Ec2?

Tags:

amazon-ec2

i wan to install FTP service on my amazon Ec2 window instance, i have some questions regarding this.

  1. which is a good FTP demon to install on EC2 service for windows on EC2 instance.
  2. can we install FTP same as we can do on window server with window CD.
  3. any tutorial or videos of installation and configuration FTp on Ec2 server which help we?

kindly help me in this regards. Thanks

like image 897
Arsalan Avatar asked May 02 '11 10:05

Arsalan


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.

Does AWS allow FTP?

AWS Transfer Family provides fully managed file transfers over SFTP, FTPS, and FTP for Amazon S3 and Amazon EFS.


2 Answers

Here you will find a great tutorial that explains also the inner workings and problems you might encounter trying to setup an ftp server on amazon EC2 instance.

It also explains why just opening port 21 on the amazon firewall will not work. The example there uses the free filezilla ftp server and client but any can be used.

http://me-ol-blog.blogspot.com/2011/03/how-to-install-ftp-server-on-amazon-aws.html

Edited (24-sep-2013):

Because the best policy practice for stackoverflow says not to rely on links, i copied the info from my blog to here:

How to install an FTP Server on amazon AWS EC2

This seems to be a big issue as people usually waste a lot of time on this.

The problem lies with 2 elements: the security group settings & the ftp server settings.

FTP is not considered a good solution for passing files between EC2 instances and your computer as it is not firewall "friendly" - you can't just open port 21/TCP on the amazon security group settings because the server is actually sitting on a NAT address and when an ftp client connects to an FTP server using PASV mode then the server tells the client which port and which address to use for the data stream (like directory listing).

If you want an alternate easy solution for transferring files between yourself and the EC2 instance then setup a dropbox on both machines - it doesn't get easier than this... :)

If  you still want to set up an FTP server on your EC2 instance then read on...

Typically, people just try to open port 21 and then try to connect and get something similar to:

Status:    Server sent passive reply with unroutable address. Using server address instead.
Command:    MLSD
Response:    425 Can't open data connection.

The solution is (and for this example I will explain how to perform the setting on FileZilla FTP server on windows):

1. FileZilla FTP server: Edit-> settings -> Passive mode settings:
 (x) Retrieve external IP from:
       http://ip.filezilla-project.org/ip.php
[ this tells the ftp server to perform a 'whatismyip' and give that to the ftp client, you can also specifically put the address DNS name you use in your remote desktop in the "Use the following IP:", e.g., ec2-6-100-129-60.compute-1.amazonaws.com ]

(x) Use custom port range:
1024-1048

 [ these are the ports that will be given to the ftp client - we will open them in the following step in the Firewall ]

2. Amazon security groups: open ports -
   a. Custom TCP rule , Port range:21
   b. Custom TCP rule, Port range:1024-1048

3. Turn off the windows firewall on the EC2 machine (you don't need it - you have the amazon firewall)

That's it, and just as side note, you don't need to use Elastic IP feature for this to work.
Also don't forget to set your client to use PASV mode (which is typically the default).

You can verify this works by reading the answer the server gives the client when it enters PASV mode:

Command:    PASV
Response:    227 Entering Passive Mode (174,149,71,102,4,7)

This response means: "Yo FTP client, use 174.149.71.102 and port 4*256+7=1031"
like image 188
thedrs Avatar answered Sep 19 '22 12:09

thedrs


The Windows EC2 instances are all Windows Server 2008. The easiest thing to do would be to enable the built-in FTP functionality.

See http://www.youtube.com/watch?v=QsGPqkobCs8.

like image 38
RawwrBag Avatar answered Sep 18 '22 12:09

RawwrBag