This is what I see:
$ telnet ec2-???-???-232-82.compute-1.amazonaws.com 21
Trying ???.???.232.82...
Connected to ec2-???-???-232-82.compute-1.amazonaws.com.
Escape character is '^]'.
220 (vsFTPd 2.3.5)
USER foo
331 Please specify the password.
PASS secret
230 Login successful.
PASV
Connection closed by foreign host.
Why this may happen?
This is part of /etc/vsftpd.conf
:
pasv_enable=YES
pasv_min_port=5000
pasv_max_port=5200
You might need to authorise the chosen passive ports for your instance. This can be done in the AWS management console with
ec2-authorize default -p <starting port>-<end port>
so it should be
ec2-authorize default -p 5000-5200
in your case.
Edit: and of course, don't forget to note the public adress with
pasv_address=???.???.232.82
like you pointed out.
For others ending up here 7 years later: I had a problem with immediately dropped connections on an EC2 instance after
PASV
, caused by vsftpd listening on ipv6.Fixed by setting
listen_ipv6=NO
andlisten=YES
.