What to Do When Connection Attempt Failed With Econnrefused Connection Refused By Server

FileZilla is a widespread, popular and free open-source FTP, FTPS and SFTP client designed for uploading and downloading files. While it works great out of the box, you may see an error on occasions, and the most common being the “ECONNREFUSED – Server denial.

You will quickly see you have this error ‘could not connect’ with the display of the following refused by server error message.

Status: Connection to someserver:21…

Status: Connection attempt failed with “ECONNREFUSED – Connection rejected by server”. Error: Connection to the server failed

You will see this as you try and connect, and it can happen for many reasons. The issue is, what works for one person may not work for another.

Here you can find out the causes, and what you can do to fix the ECONNNREFUSED connection refused to connect to server issue.

Connection Error Filezilla

What is Connection Refused by Server?

One of the most straightforward solutions to the ECONNREFUSED connection refused by server error issues are among the most common. You will find the FTP and SFTP both cater for similar purposes, although they do offer a few key differences.

Two of the key differences are as follows:

  • FTP isn’t encrypted by default. It also uses port 21 as the default setting
  • SFTP has encryption by default. The default port is set as port 22

If you find your localhost refused to connect, this shows the issue is preventing your connection leaving your machine rather than a refused by server error.

How Do I Fix Connection Refused Error?

On some occasions, you can find that switching the port in use can resolve this issue with the ECONNREFUSED connection refused error message.

You will find it more common when you change ports from port 21 to 22 addresses the issue because ISPs and IT teams can often block port 21. However, there are times when switching from port 22 to port 21 can fix the error. (We have a workaround for the ISP block later)

It is straightforward to change your port number inside FileZilla. All you need to do is input the port number inside the Port field in the FileZilla control panel.

Another possible reason for the ECONNREFUSED connection refused by server error is the firewall and anti-virus software stops FileZilla making connections.

To check if this is the cause, you can disable the firewall and anti-virus and try to reconnect. Here are the steps for Windows:

  1. Press the Windows key and type Control Panel, and press enter
  2. Click the Windows Defender Firewall.
  3. On the left side, menu click on Turn Windows Defender Firewall on or off.
  4. In the next window, toggle the settings to OFF for Windows Defender Firewall for public and private networks
  5. Press Ok

*Note: It isn’t safe to not use Windows Defender, and you should enable this no matter what your results. If FileZilla connects, you can add an exception to the firewall.

Fix Connection Refused Error in PuTTY

How Do I Fix a Connection Refused Error in PuTTY?

PuTTY is a free and open-source terminal app, which system admin can use to login to a remote server over SSH. It also allows you to send files securely using SCP or SFTP once you have the IP address to connect to.

PuTTY is reliable, yet it can also throw up errors.

The error “Network error: connection refused” is common and can happen at any time when trying to remote connect.

  • Contact the system/network administrator: System admin may make changes to router permissions if an unknown device is trying to connect. Contact system admin and let them know you are trying to connect with PuTTY
  • Check if SSH connection is enabled: Depending on the device you try to connect; you may see an error as the device settings for SSH is disabled.
  • Check if your domain records points to the server: On new servers and fresh domains, you can see this error because of incorrect DNS server address in domain settings. To fix, log in to your domain name provider and check name server settings are directed toward your hosting provider.
  • Disable Firewall: On Win 10, the default Windows Security firewall and protection features may block incoming connections. Try to disable the firewall to see if you can resolve the connection refused error. Add an exception to the firewall and Whitelist your PuTTY app.

How do I Unblock FileZilla Firewall?

If you are running or setting up the FileZilla Server, then you will need to add an exception to the firewall.

Here are the steps to do this with the Windows Firewall.

  1. Click on the start menu and type ‘Control Panel’
  2. Inside the Control Panel, Open Windows Firewall
  3. Select the ‘Allow an app or feature through windows defender firewall’
  4. Click ‘change settings’
  5. Click ‘allow another app’
    Note* Be sure not to select ‘FileZilla Server Interface’
  6. Click ‘Browse’
  7. Search for your FileZilla server directory (typically ‘C:\Program Files\FileZilla Server\’)
  8. Select ‘FileZilla server.exe’ and click on ‘Open’
  9. Select ‘FileZilla server.exe’ in your list and click ‘Ok’
  10. Check you have added ‘FileZilla server.exe’ to your exceptions list and the boxes are check-marked for public and private
  11. Press ‘Ok to finalise and close the window
  12. Open your command prompt with admin rights and run the following command: netsh advfirewall set global statefulftp disable

You should find you can access your devices and you no longer have the ‘error could not connect’ issue.

One way you may be able to bypass some of the above issues are to use a VPN service. Once you install the client app and connect to server from the list, your VPN changes your IP address.

You will also find your firewall may automatically ask you to allow the app. Click yes, and you are free to carry on with FileZilla using a new IP address that is assigned by your VPN.

Now you have a new IP address; you should find your ISP won’t block your IP address as they are unable to read the contents of your data packets. Besides this and the many other features, a VPN can help reduce the chances of your’ error could not connect’ to server problems.

Read more: How To Hide Ip Address

What to Do When Connection Attempt Failed With Econnrefused Connection Refused By Server