Ubuntu – Connection timed out ftp cannot connect

firewallftpUbuntu

I have a ubuntu server and am trying to connect using filezilla but keep getting connection timed out.

I have done an nmap and the port that is opened for ftp is 21.

I have gone onto the server and done an ftp on localhost and it works fine.

I have also tried to ftp via terminal command but connection times out on there as well.

Not sure what else i can do allow ftp?

Best Answer

Check the firewall on the client machine, or set the mode to passive.

There are actually two separate connections, a data channel and a command channel. It's common for the data channel to be blocked by the client machine's firewall.

This Stack Overflow answer explains it well.

The comment thread above reminds me that I should probably point out that FTP isn't secure. Unless you have a business reason that requires FTP, you might want to consider SCP or SFTP instead. (Bonus: They don't include the port wackiness that you're running into.)