I am trying to transfer a file from linux server to macosx machine using scp.

scp test username@

it shows error

ssh: connect to host port 22: Connection refused lost connection.

I checked firewall settings on mac it allows all connections from all machine. Please help me asap.

Let me know if you need any other information.

  • Is sshd up and running? – Dave G Mar 25 '11 at 18:31
  • Have you tried ssh -vvv test username@ ? This will give you more info on the error. – mooreds Mar 25 '11 at 18:35

Connection refused, if not the firewall, often indicates that the ssh service is not running on the remote computer.


ps -aux | grep sshd

on the remote computer will verify if it's running or not - IF you can somehow access that remote box.

| improve this answer | |

On the Mac, go to System Preferences > Sharing and make sure Remote Login is enabled (checked).

Also, shouldn't you have escaped the ~ in that scp command? Otherwise I'm afraid your local (Linux) shell will swallow it and replace it with the path to your Linux account's home directory.

| improve this answer | |

Try installing openssh-client and openssh-server on your target computer if Linux. Otherwise the suitable ssh server for your Operating System.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy