Transfer file from remote machine to local machine

Yubin Ruan ablacktshirt at gmail.com
Mon Jul 17 00:33:16 UTC 2017


2017-07-17 4:19 GMT+08:00 Thomas Kaiser <thomas at kaiser-linux.li>:
> On 16.07.2017 18:15, Yubin Ruan wrote:
>>
>> Hi,
>> I am having some trouble with transfering file from remote machine to
>> local machine.
>>
>> I got a remote machine A and a remote machine B. Usually I log into
>> remote machine A using ssh and then use A as a relay to log into
>> remote machine B. But when I am in B, I don't know how to copy file
>> directly from B to my local machine.
>
>
> Create a ssh tunnel...
>
> From local machine in the first terminal:
> ssh -L 2222:remoteB:22 remoteA

A ssh tunnel would be great. But I cannot access remoteB from my local
machine (DNS resolution would fail).

> now you have a tunnel from local machine to remoteB on port 2222.
>
> From local machine in the second terminal:
> scp -P 2222 localhost:/path/to/file .
>
> /path/to/file is on remoteB (trough the tunnel on port 2222)
>
> Hope this helps.
>
> Thomas
>
>




More information about the ubuntu-users mailing list