Enable reverse tunelling on port 2224 locally…
echo "RemoteForward 2224 localhost:2224" >> ~/.ssh/config
SSH in to your server (I've only tried this on an Amazon AMI) and cat something
cat large-file.txt | nc localhost 2224
Gape in awe as the contents of large-file.txt are copied to the clipboard of your Mac. You may want to alias nc localhost 2224
to pbcopy
.
###Bonus tip for Vim users
Add this to your .vimrc
" Maps pbcopy in command mode to copy back out to Mac session
cmap pbcopy !nc localhost 2224<CR>u
Select some text, switch to command mode and type pbcopy
and voila!