I am trying to transfer a file to Computer A (my computer) from Computer B (the remote computer). I have looked through different threads, but nothing is working. First, I log onto Computer B using ssh which works fine. My code for the file transfer is

scp userB@hostB:~/Desktop/(file_name) ~/Desktop/

when I plug this in, it asks for Computer Bs password, which I enter. Then I get the error

scp: /Users/userB/Desktop/(file_name) : No such file or directory

I know that the file is there, however. What am I doing wrong?

  • See Scott's answer below. Use the full path instead of the aliased path. Also, you should be doing this from Computer A, not ssh-ing into Computer B first.
    – Allan
    May 16, 2017 at 3:02

1 Answer 1


Have you tried, while logged on to Computer A :

scp (Computer B user)@(Computer B address):/Users/(Computer B user)/Desktop/(file_name) ~/Desktop/

It's more explicit than using ~, which may not behave as you might want it to on the remote machine - although it will be fine for local file specifications.

  • See my comment above re: location where he is issuing the command. He is logging into B and trying to copy a file from B/Desktop to B/Desktop.
    – Allan
    May 16, 2017 at 3:06
  • Yeah, the whole thing was confusing ... May 16, 2017 at 3:07
  • Agree - I had to edit his usernames and hosts to make it easier to understand. Just upvoted.
    – Allan
    May 16, 2017 at 3:12
  • I have clarified my answer a little May 16, 2017 at 3:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .