On Thu, Nov 09, 2023 at 12:22:43PM +0000, Mark Rogers wrote:
I often seem to find myself in this scenario:
- I SSH into Server A using my personal key
- I SSH into Server B using my personal key
I find files I need on B that I need to transfer from B
Usually the files are quite small so I'll just transfer them to my own PC as an intermediary. But I now need to transfer about 30GB from A to B so it seems like the right time to find a better way.
I don't really want to have to give A permanent access to B (albeit I can always delete the key later, it seems like the sort of thing that would get forgotten).
Use an SSH agent on your local machine, login to A forwarding the agent (ssh -A HostA) then use scp on A to pull the file from B? Your key never leaves your desktop, but can be used on A while you're connected.
(For added paranoia add the key to the agent with "ssh-add -c" so that all use has to be confirmed.)
J.