Transfer file from remote machine to local machine

Xen list at xenhideout.nl
Sun Jul 16 16:45:52 UTC 2017


Yubin Ruan schreef op 16-07-2017 18:15:
> 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.
> 
> Because remote machine A is a relay and I don't have write permission,
> I cannot transfer file from B to A. And because B is only visible to A
> (since B is a internal machine), I cannot access B directly from my
> local machine.
> 
> I have tried those sz/rz utilities but it seems that they does not
> work as expected on Ubuntu, probably because of some terminal issues.
> 
> Some people suggest printing directly to the terminal and do some
> copy-and-paste ... well, that file is pretty large, so it would be
> better to handle the transfer with some programs or scripts ;-)
> 
> Please give me some suggestions.

Maybe you can create an SSHFS mount from the B to the A, and then mount 
that same mount point (on A) again on your client.

Ideally you want this to be a bit fixed because it is a pain setting up.

I mean it's easy but gets tiring.

I assume A is not something you own or control.

Personally I am using internal routing using a VPN for something like 
that.

What SSH really misses is a way to "get" a file where you are.

So here is my setup to give the full picture.

Local small server (NAS) gives off an extra route using DHCP.

This is dnsmasq lingo:

dhcp-option=option:classless-static-route,10.8.1.0/24,192.168.1.2,10.3.0.0/24,192.168.1.2

10.8.1.0 is the VPN, 10.3.0.0 is an internal subnet of the remote VPN 
client.

So my local computers obtain routing information for both the VPN and 
the subnet behind the VPN (behind the client).

The VPN client itself also has a route to the 10.3.0.0 subnet of course 
and with a little bit of VPN trickery it also forwards everything over 
the VPN.

So now I have direct access to the internal subnet over the VPN. Not to 
brag or anything, just to show a possible configuration here. My client 
has direct access to "B" even though it is not exposed over the internet 
in that way.

Anyway, Regards.




More information about the ubuntu-users mailing list