Software⏱️ 4 min read📅 2026-06-11

How to Fix: scp connection refused error

Troubleshooting scp connection refused error on Linux to MacOS transfer.

Quick Answer: Check the firewall settings on both ends, ensure the server is reachable and not blocked by any proxy or NAT.

The 'scp connection refused error' is an issue that affects users trying to transfer files between Linux servers and macOS machines using the Secure Copy (SCP) protocol. This error occurs when the SSH connection cannot be established due to a refusal from the remote host, in this case, the Linux server at IP address 68.120.23.91.

This error can be frustrating as it prevents users from transferring crucial files and data between systems. In this guide, we will walk through the possible causes of this error and provide two primary methods to resolve the issue.

💡 Why You Are Getting This Error

  • The first main reason why the 'scp connection refused error' occurs is due to incorrect firewall settings on the remote Linux server or a misconfiguration in the SSH service. The firewall might be blocking incoming connections from the macOS machine, even though it has been configured to allow all connections from all machines. Additionally, if the SSH service is not running or not properly configured, it can also cause this error.
  • Another alternative reason for this error could be a network issue between the two systems, such as a misconfigured DNS resolution or a temporary network outage. However, since you have confirmed that your macOS machine's firewall settings allow all connections from all machines, this is less likely to be the cause.

🔧 Proven Troubleshooting Steps

Verify and correct firewall settings on the remote Linux server

  1. Step 1: Open a terminal on the remote Linux server and check its firewall configuration using the command 'ufw status'. Verify that incoming connections from your macOS machine's IP address are allowed. If not, you may need to add a rule to allow these connections.
  2. Step 2: If the firewall is configured correctly, try restarting the SSH service on the Linux server using the command 'sudo systemctl restart sshd'. This will ensure that any existing SSH connections are terminated and a new connection can be established.
  3. Step 3: After making these changes, attempt to reconnect to the remote server using SCP again. If you still encounter the error, proceed with method 2.

Check network connectivity and DNS resolution

  1. Step 1: Use a command like 'ping -c 1 68.120.23.91' from your macOS machine to check if there is any network connectivity issue. If the ping fails, you may need to investigate further with your network administrator.
  2. Step 2: Verify that DNS resolution is working correctly on both systems by using the command 'dig +short test' on your macOS machine and comparing the output with what is expected for the remote server's IP address.

🎯 Final Words

To resolve the 'scp connection refused error', first verify and correct any firewall settings on the remote Linux server, and then check network connectivity and DNS resolution. If you are still experiencing issues after trying these methods, it may be helpful to consult with your system administrator or IT support team for further assistance.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions