Hacker News new | ask | show | jobs
by stock_toaster 1268 days ago
Use a reverse port forward via ssh.

  ssh -R 127.0.0.1:2210:127.0.0.1:22 user@somemachine
Of course you could instead add it to your ssh config along with agent forwarding.
2 comments

Just for other people arriving from Google who might think this is too much work, it seems to be enough for my use case to just type

    ssh user@host "cat foo.txt" | pbcopy
from my Mac terminal.
This is what I was hinting at with:

> One could perhaps set something up to forward a connection to a local daemon […] [but complexity]

Reverse port forwarding is exactly what I do. You can make it automatic for certain hosts using ssh_config.