No connection could be made because the target machine actively refused it. Connection closed.

Problem

When you try to connect to the FTP server you get one of the following error messages: No connection could be made because the target machine actively refused it. Connection closed. Connection timeout. No response from server.

Causes/Solutions

FTP server settings

The error is occurring because there is no server listening at the host name and port you entered. Check that you have specified the correct host and port.  Port 21 is the default FTP port. 

Software/Personal Firewall Settings

Another common reason is that a firewall software (Microsoft OneCare, McAfee Total Protection, Norton Internet Security, etc) running on your system is stopping your FTP client from making outgoing connections. To fix this problem add your FTP client to the list of allowed applications in your firewall software.

Multiple Software/Personal Firewalls

If you have Windows XP firewall enabled and a third party firewall software (e.g. McAfee Total Protection, etc.) installed, disable the Windows XP firewall or uninstall the third party firewall software. There are known problems with having both firewall applications running at the same time.

Anti-virus Software

If you are running anti-virus software and having strange problems connecting, disable the "Worm protection" in Norton Anti-virus. If McAfee VirusScan is installed and the "Spyware Plugin" is enabled, go to McAfee VirusScan Console and uncheck the "Prevent FTP outbound" option in the "Port Blocking" dialog of the "Access Protection Properties".  You also might need to add your FTP client to the exception list.

LSP Layer

Software firewall applications and other utilities hook into the LSP layers of Winsock. If the hook is not properly written, connection attempts may fail under certain situations.

The solution is to identify and update the application causing the problem. Spyware and adware are known to hook into the LSP layers as well. To remove them install and run Ad-Aware. To manually remove LSP hooks install the LSP Explorer add-on for Ad-Aware. This procedure is recommended for experienced users only. It's easy to break the system.

Router Firmware

This is an unlikely case but a buggy router firmware may cause exactly the problem described above (e.g. Linksys). To fix it update the firmware of your router. You can usually update the router firmware in the router web administration interface or visit the manufacturer's website for router updates and further information.