FTP Server Connection Issues – Only FileZilla Works

amazon ec2ftplinuxvsftpd

I have created a FTP Server on a Amazon-EC2 instance following this DigitalOcean Tutorial, I can login normally and that's the only part that works remotely using the shell(connecting from server to localhost doesn't give any problem), but any command that i give to FTP client( e.g. ls or put source destination) doesn't work.
The tutorial sets the server to work in PASSIVE mode, but while looking for solutions online and the people had a problem with mode X, the solution was switching from mode X to mode Y and viceversa.


FTP (verbose mode) gives two different outputs:

  • While connection is on ACTIVE mode
ftp> dir
500 Illegal PORT command.
ftp: bind: Address already in use
  • When connection is on PASSIVE mode
ftp> dir
227 Entering Passive Mode (addr, of, my, server, port1, port2).
ftp: connect: Connection timed out

Although the command line FTP client can't perform any operation different from login, Filezilla can.
I guess the solution lies in filezilla status logs:

Status: Connecting to addr:21...
Status: Connection established, waiting for welcome message...
Status: Insecure server, it does not support FTP over TLS.
Status: Server does not support non-ASCII characters.
Status: Logged in
Status: Retrieving directory listing...
Status: Server sent passive reply with unroutable address. Using server address instead.
Status: Calculating timezone offset of server...
Status: Timezone offset of server is 0 seconds.
Status: Directory listing of "/" successful

For your information, using Filezilla is not an option: I just installed it to have a good looking client to perform basic operations and tests, but it turned out to be the only client that could do something.

Best Answer

I had this problem with a server hosted on AWS EC2.

I solved it by disabling listen_ipv6 and adding below attributes in the config and then restart vsftpd

listen_ipv6=NO
listen=YES
pasv_enable=YES
pasv_address=ec2-external-ip