Tonight I needed to transfer files directly between two servers via the terminal and figured this would be useful information for others, so here’s how to do it:
Upload to a remove server:
$ ssh username@remote_address cat < localfile ">" remote_file |
Download to your server:
$ ssh username@remote_address cat remote_file > local_file |
Source: the incomplete news project