M HYPE SPLASH
// general

scp connection refused error

By Michael Henderson

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

scp test username@68.120.23.91:~/

it shows error

ssh: connect to host 68.120.23.91 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.

2

4 Answers

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

Running

ps -aux | grep sshd

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

2

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.

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

If your ssh connection uses a specific port, set it for scp as well with

scp -P 1234 <other params>

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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