I have three machines A, B, C. The aim is to be able to transfer files from A to C. I have ssh access from A to B, and B to C; B and C are on a local network.
This can be achieved with the
scp -o ProxyCommand option and it works.
But before I stumbled upon this solution I tried an
ssh -L method which didn't work. The problem was identified but not the solution. First an ssh local redirect was setup from A to C (on A) via. B like so:
ssh -p 8888 -L 5022:userC@hostC:22 userB@hostB
Using ssh to verify/test on A:
ssh -p 5022 userC@localhost
This fails on A saying:
ssh_exchange_identification: Connection closed by remote host
/var/log/auth.log on B says:
sshd: error: connect_to userC@hostC: unknown host (Temporary failure in name resolution)
I have verified that that the colon symbol (:) after hostC is causing the fault but have not found a way to fix this. any ideas would be useful.