0

I have successfully transferred a file from a Linux machine to windows. But I am unable to transfer the file to a MacBook Air that I have. I have already tried going to system preferences and was able to verify I have remote login selected.

The syntax I am using is scp -P PORTNUM FILE_NAME USERNAME@IP_ADDRESS:FILE_PATH

I receive the error message, connection refused connection timed out.

The most progress I have made was when I also included the username and IP address of where the source file is located. It asked to add a key fingerprint and continue connection which I typed yes to.

It then prompts me to enter a password, but once I do it never actually makes a connection and ends saying connection time out after a few minutes.

Romeo Ninov
  • 5,319
  • 5
  • 20
  • 20
  • SCP (Secure CP) relies on SSH protocol, so for this to work your MacBook must have a running SSH server. – Peregrino69 Sep 23 '21 at 07:59
  • 1
    Are you able to `ssh` to the remote OS? Are you able to run a non-interactive command via ssh? E.g. `ssh -p PORTNUM USERNAME@IP_ADDRESS date`. If not then this has to be fixed first because (local) `scp` works by running (remote) `scp` via `ssh` (like we run `date` in the example). This also means `scp` has to be available in the remote system. – Kamil Maciorowski Sep 23 '21 at 08:11
  • 1
    See [How do you run a SSH server on Mac OS X](https://superuser.com/questions/104929/how-do-you-run-a-ssh-server-on-mac-os-x). – harrymc Sep 23 '21 at 08:42
  • 1
    it's not clear from your description what is actually happening. Try running `ssh -vv -p portnum user@host 'echo hello'` (with the correct port, username, and host for this remote system). This will print debugging output while connecting to the remote system and running a simple command. Then [edit] your question to include everything that ssh printed. – Kenster Sep 23 '21 at 12:28

0 Answers0