You may get this error while connecting your client to FTP server. FTP client getting error 425 Failed to establish connection, while listing directory contents. FTP server gets “connection refused” when establishing Active FTP to FTP client.
First of all Check
vi /etc/vsftpd/vsftpd.conf
check following parameters are uncommented and value is set as given
anonymous_enable=YES (This can be set as NO also in case of not allowing anonymous)
local_enable=YES
write_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
data_connection_timeout=120
listen=NO
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
Check your iptable service. if it’s on, change it to off.
/etc/init.d/iptables stop
If above solution doesn’t work. run following command
modprobe ip_conntrack_ftp
if you have hosted over cloud or other have iptables on make sure vsftpd ports are open. Mostly it runs from 10000 or above.
You may get following error in listing.
200 PORT command successful. Consider using PASV. 425 Failed to establish connection
it means vsftpd ftp login successful but failed to establish connection while directory listing. make sure your client is passive enable ftp connection.
pasv_enable=YES
pasv_max_port=10001
pasv_min_port=10000
Allow the same ports to be access in iptables.
iptables -I INPUT -p tcp --destination-port 10000:10001 -j ACCEPT