Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

migrated from Mar 26 '11 at 4:01

This question came from our site for professional and enthusiast programmers.

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.

share|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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.