On my mac, logged in via ssh to a remote host, I am experiencing difficulty transferring files to my laptop from the remote computer in the window where I am ssh'd into the remote computer. Is this supposed to be possible to do? I can't possibly think of why not. In this situation, I can go remote to another remote no problem.

on my local mac machine, if I run:


it returns my hostname - "hostname" let's say.

Then in the window where I am ssh'd into the remote computer, in a directory with file.txt, I try:

scp file.txt hostname@my_public_IP_address:path_to_destination

This does not even return anything at all. The command line doesn't come back either. Even when I use the -v verbose flag.

for path_to_destination, I have tried a few things:

~/Users/ ....

where in each case above the "/..." was tried either as "/", "/.../", or "/..." with "..." just continuing the file path specification further. To me, any of these really should work.

If I do "cd ~" on my mac, and the "pwd", I get


Could someone kindly tell me either what I am doing wrong here or notify me that what I am trying to do is for some reason forbidden. I just find it strange that it just "hangs up" like this. I have looked around for a few days to try and figure this out with no luck. Thanks...

  • looks like you have NAT (Network Adress Translation) between you (hostname) and remote host. Have you map port 22 of your public IP to your local IP ?
    – Archemar
    Feb 17, 2020 at 7:56

1 Answer 1


I would start with checking if you are able to connect to the port 22 of that host: telnet my_public_IP_address 22 if you will get anything (you should get OpenSSH server reply), that means you can debug that on scp/ssh server level. If not - your problem is network related (which it's probably is).

You must log in to answer this question.

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