1

I created an Ubuntu instance on AWS and wanted to set up the FTP server. I referred this article on setting up vsftdp. I opened port 20,21,22 on my aws.

Now when I am using http://ftptest.net/ to check my configuration, it throws error;

Error: Reply does not contain valid response code
The replies sent by your server are violating the FTP specifications.
You have to upgrade to a proper server.

I am not able to really understand what could be the problem. Could anyone please help me? Thanks.

Jayesh
  • 113
  • 1
  • 4
  • 1
    Possible duplicates: http://serverfault.com/questions/334308/setting-up-vsftpd-on-aws-ec2-instance http://serverfault.com/questions/222340/ftp-issue-vsftpd-and-connecting-to-from-filezilla – snap Jul 17 '12 at 08:48

2 Answers2

2

FTP does not work well with NAT because it embeds IP addresses within the control protocol when a data connection is opened. Unfortunately EC2 instances are connected to internet through NAT. Normally NAT firewalls have a special helper application which looks into the control traffic and corrects the IP addresses on the fly. EC2 NAT does not have this functionality.

I believe that your problem can be solved by adding the following in your vsftpd configuration:

pasv_address = YOUR.PUBLIC.IP.ADDRESS

Edited to add:

You also need to open more ports for FTP data connections in PASV mode as described in the article you are linking to. In your question you mention that you have not opened all the ports as instructed in the article.

snap
  • 1,251
  • 10
  • 18
  • I have opened the rest of the ports mentioned in the article. I tried putting pasv_address but I am getting the same error. Is there anything else I can use to check if the configuration is proper? – Jayesh Jul 17 '12 at 08:47
  • @Johnny: It would be helpful if you could add output of a failing ftp session. – snap Jul 17 '12 at 08:50
  • _please excuse bad formatting_ **Status:** Connecting to 'PublicDNS'... **Response:** fzSftp started **Command:** open "ubuntu@PublicDNS" 22 **Command:** Trust new Hostkey: Once **Error:** Disconnected: No supported authentication methods available (server sent: publickey) **Error:** Could not connect to server – Jayesh Jul 17 '12 at 09:01
  • I get this on FileZilla – Jayesh Jul 17 '12 at 09:02
  • 1
    Johnny: You are confused about *FTP* and *SFTP*. Which one you want to use? If you want to use *SFTP* you do not need vsftpd because it implements *FTP*. You are obviously connecting with some *SFTP* client which runs over *SSH*. With the EC2 default configuration you need to authenticate *SSH/SFTP* sessions using your key pair. – snap Jul 17 '12 at 09:05
  • Actually. Yes. I was doing this for the first time. I got it working. Thanks :) – Jayesh Jul 17 '12 at 09:13
2

I found this http://quadloops.com/installing-up-ftp-server-in-amazon-ec2-ubuntu-server-12-04/ Its the simplest way to have FTP server vsftpd in Ubuntu in AWS. You have to set your FTP client to active mode to use it.

Manu
  • 121
  • 2