B
B
BadThings2020-04-28 11:36:12
SSH
BadThings, 2020-04-28 11:36:12

[SSH] How to connect to two machines at once, despite the fact that they are on different networks?

How it should work:
From my home PC (machine No. 0) on w10 through VPN1 I get SSH access to machine No. 1, which:
1. with VPN2 disabled, has access to machine No. 2 in the same VPN1 via SSH
2. with VPN2 enabled, it has access to machine #3 via SSH
3. Can't access #2

from #3 Need: transfer files from #3 to #2 from computer #1 (ssh from #0)
Alternative option: Transfer files from #3 to #0

Tried Google how to directly transfer via scp to #0 through a double bridge from #3, did not work.
Now I'm trying to transfer files through mc to No. 1, but apparently I run into problem No. 3, because as far as I understand "scp #1 -> #2" requires access from #1 to #2

How can I solve this problem, or do I need to come up with workarounds such as transferring to #1 and from there, turning on / off the VPN, transfer files?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
FanatPHP, 2020-04-28
@FanatPHP

Understood nothing.
What prevents you from turning on vpn on 1, downloading files from 3, turning off vpn and uploading to 2?

V
Vadim Misbakh-Soloviev, 2020-07-03
@mva

1) scp has a magic option "-3":

-3 Copies between two remote hosts are transferred through the local host. Without this option the data is copied directly between the two remote hosts. Note that this option disables the progress meter.

2) and there is also rsync

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question