I'm following the answer on How to scp from server to server with different public keys? but I'm getting a connection error:
# start the agent and capture its environment in the current shell eval `ssh-agent` # add keys needed to connect to the different accounts ssh-add /path/to/first/ssh/key ssh-add /path/to/second/ssh/key # do the copying $ scp -r user@server1:/images user@server2:/images ssh: connect to host server2 port 22: Connection timed out lost connection
It works if I use my machine as an explicit intermediary:
$ scp -r user@server1:/images /images $ scp -r /images user@server2:/images
Any clues on why it's failing to do the copy in one step?