Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
1  
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
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? –  Johnny Jul 17 '12 at 8:47
    
@Johnny: It would be helpful if you could add output of a failing ftp session. –  snap Jul 17 '12 at 8: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 –  Johnny Jul 17 '12 at 9:01
    
I get this on FileZilla –  Johnny Jul 17 '12 at 9: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 9:05
show 1 more comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.