When you ssh into a machine and run cp fromFile toFile
, that copy runs completely on the remote machine. It does not communicate over ssh to do the copy. In fact, without any arguments, cp won't even report progress to the ssh session, it will only complete and then you'll see the prompt.
If you are copying a lot of small files, and use cp -v
, cp will print the name of each file as it copies it. Printing the name will cause communication over the ssh connection. It's possible that if you have a slow connection, the cp command will print filenames faster than ssh can transmit them over the wire, and it seems possible that after printing enough filenames, cp could block trying to write to stdout.
I've never actually seen this happen, and disk speed has always been the limiting factor, but I think it's theoretically possible.