Transfer file from remote machine to local machine

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
18 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Transfer file from remote machine to local machine

Yubin Ruan
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.

Thanks,
Yubin

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Xen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Xen
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.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Colin Law
In reply to this post by Yubin Ruan
On 16 July 2017 at 17:15, Yubin Ruan <[hidden email]> 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.
>
> 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.

You have not said whether you can access the local machine from B.
Also can you access A from B and can you access local m/c from A?

Colin

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Yubin Ruan
In reply to this post by Yubin Ruan
2017-07-17 4:19 GMT+08:00 Thomas Kaiser <[hidden email]>:

> 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
>
>

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Yubin Ruan
In reply to this post by Colin Law
2017-07-17 4:49 GMT+08:00 Colin Law <[hidden email]>:

> On 16 July 2017 at 17:15, Yubin Ruan <[hidden email]> 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.
>>
>> 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.
>
> You have not said whether you can access the local machine from B.
> Also can you access A from B and can you access local m/c from A?

Sorry for that.
I cannot access the local machine from either B or  because my local
machine is behind a NAT. I can access A from B but I don't have write
permission on A (I don't own A. A is used as a relay, so you cannot do
much on A).

Yubin

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Jeff Lane-2

On Sun, Jul 16, 2017 at 20:36 Yubin Ruan <[hidden email]> wrote:
2017-07-17 4:49 GMT+08:00 Colin Law <[hidden email]>:
> On 16 July 2017 at 17:15, Yubin Ruan <[hidden email]> 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.
>>
>> 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.
>
> You have not said whether you can access the local machine from B.
> Also can you access A from B and can you access local m/c from A?

Sorry for that.
I cannot access the local machine from either B or  because my local
machine is behind a NAT. I can access A from B but I don't have write
permission on A (I don't own A. A is used as a relay, so you cannot do
much on A).

How about sshuttle? Running sshuttle to connect to A will create a VPN connection via ssh and will set up routes so you should then be able to scp from B to Local. 






Yubin

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Karl Auer
In reply to this post by Yubin Ruan
On Mon, 2017-07-17 at 00:15 +0800, Yubin Ruan wrote:
> 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.

You need a tunnel!

Assuming that:
a) you can ssh from your system to machine A
b) you can ssh from machine A to machine B
c) you have credentials for machine B

... then you can set up a tunnel.

On your system:

   ssh -L 2222:localhost:2222 youA@machineA

On A:
   ssh -f -N -L 2222:localhost:22 youB@machineB

On your system:

   scp -p 2222 youB@localhost:/path/on/B/file.dat .

That will copy /path/on/B/file.dat to your current working directory on
your local system.

If you have password access on A and B you will be asked for your
password three times - once by A, once by B, then again by B. 

If you have publickey access on all system, make sure you put a copy of
your private key from A for B on your local system[1], and specify it
to scp using the -i option.

If you'll be doing this more than once, wrap it all up in a script. You
may find you have problems with ptys and so on if you script this; if
that happens, check out the -t option to ssh for the first hop.

There is nothing special about "2222" - you can use any free port
number above 1024. Nor does it have to be the same port number on both
A and B - as long as the destination on A is the same as the source on
B.

There *is* something special about the port number 22. If the ssh port
on B is not 22, you should use that other port number instead.

The above commands are off the top of my head. Apologies for typos,
proceed with care and adjust as needed.

Regards, K.

[1] Be careful with private keys! Respect any security policies that
may apply, and store the key at least as securely as you do any other
employer/customer keys. This technique may violate local security
policies on A, B or both; if in any doubt, check with the local
sysadmins BEFORE you try this.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer ([hidden email])
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: A52E F6B9 708B 51C4 85E6 1634 0571 ADF9 3C1C 6A3A
Old fingerprint: E00D 64ED 9C6A 8605 21E0 0ED0 EE64 2BEE CBCB C38B



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Karl Auer
In reply to this post by Yubin Ruan
On Mon, 2017-07-17 at 08:36 +0800, Yubin Ruan wrote:
> I cannot access the local machine from either B or  because my local
> machine is behind a NAT. I can access A from B but I don't have write
> permission on A (I don't own A. A is used as a relay, so you cannot
> do much on A).

NAT doesn't matter, and you don't need access to A from B or from
either A or B to your local system. Your connections are outwards -
from your local system to A and then from A to B. That lets you set up
a tunnel, and then you can copy across that tunnel using whatever tools
you like.

My suggestion was a tunnel for port 22 so that you can then use scp to
copy files (you could also use something like rsync).

Regards, K.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer ([hidden email])
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: A52E F6B9 708B 51C4 85E6 1634 0571 ADF9 3C1C 6A3A
Old fingerprint: E00D 64ED 9C6A 8605 21E0 0ED0 EE64 2BEE CBCB C38B



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Karl Auer
In reply to this post by Xen
On Sun, 2017-07-16 at 18:45 +0200, Xen wrote:
> What SSH really misses is a way to "get" a file where you are.

Isn't scp exactly that? If you have ssh access to  system, you have scp
access to it (modulo file permissions at each end of course).

Having that built into ssh itself would IMHO break the model of "do one
thing well".

Regards, K.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer ([hidden email])
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: A52E F6B9 708B 51C4 85E6 1634 0571 ADF9 3C1C 6A3A
Old fingerprint: E00D 64ED 9C6A 8605 21E0 0ED0 EE64 2BEE CBCB C38B



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Xen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Xen
Karl Auer schreef op 17-07-2017 12:41:
> On Sun, 2017-07-16 at 18:45 +0200, Xen wrote:
>> What SSH really misses is a way to "get" a file where you are.
>
> Isn't scp exactly that? If you have ssh access to  system, you have scp
> access to it (modulo file permissions at each end of course).
>
> Having that built into ssh itself would IMHO break the model of "do one
> thing well".

I know and I guess you can always find the client with $SSH_CLIENT
(didn't know that at first) but otherwise it can be a bit annoying.

In other words, you *can* copy back to $SSH_CLIENT but of course it
needs another login.

Personally I wouldn't mind a little more "flesh" to the whole SSH thing,
but whatever.

The X protocol allows for this, you know. But without X, you are the
proverbial 'screwed' for instance in terms of copy and paste.

So you can.... you can run a GVim session even from Windows (using
XMing) and you well have copy and paste just fine (honestly, it works)
but in raw terminals using regular Vi you are stuck with plain copy and
paste using text selection in the terminal window???

I wish we had that thing for regular Vim.

X-forwarding also works with a tunnel but yeah. PuTTY clients and other
clients can set it up automatically.

But I don't like GVim and it looks bad in a window on Windows at least.
So this very simple thing, we don't have?

Regards.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Chris Green
In reply to this post by Karl Auer
On Mon, Jul 17, 2017 at 08:41:59PM +1000, Karl Auer wrote:
> On Sun, 2017-07-16 at 18:45 +0200, Xen wrote:
> > What SSH really misses is a way to "get" a file where you are.
>
> Isn't scp exactly that? If you have ssh access to  system, you have scp
> access to it (modulo file permissions at each end of course).
>
> Having that built into ssh itself would IMHO break the model of "do one
> thing well".
>
I tend to use rsync instead of scp but otherwise I agree entirely.

--
Chris Green

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Karl Auer
On Mon, 2017-07-17 at 12:10 +0100, Chris Green wrote:
> I tend to use rsync instead of scp but otherwise I agree entirely.

rsync requires another program installed at the other end, scp doesn't.
It also has a somewhat more complicated invocation than scp. But it can
do partial copies and recover, so especially for large files or large
numbers of files, rsync is definitely the way to go, if supported at
the remote end.

Regards, K.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer ([hidden email])
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: A52E F6B9 708B 51C4 85E6 1634 0571 ADF9 3C1C 6A3A
Old fingerprint: E00D 64ED 9C6A 8605 21E0 0ED0 EE64 2BEE CBCB C38B



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Yubin Ruan
In reply to this post by Karl Auer

On Mon, Jul 17, 2017 at 04:21:02PM +1000, Karl Auer wrote:

> On Mon, 2017-07-17 at 00:15 +0800, Yubin Ruan wrote:
> > 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.
>
> You need a tunnel!
>
> Assuming that:
> a) you can ssh from your system to machine A
> b) you can ssh from machine A to machine B
> c) you have credentials for machine B
>
> ... then you can set up a tunnel.
>
> On your system:
>
>    ssh -L 2222:localhost:2222 youA@machineA
>
> On A:
>    ssh -f -N -L 2222:localhost:22 youB@machineB
>
> On your system:
>
>    scp -p 2222 youB@localhost:/path/on/B/file.dat .

This seems perfect and I agree with your suggestion. But, unfortunately, as
remoteA is used as a relay, tunneling is block on remoteA. I just cannot
create a tunnel to remoteB on remoteA.

Transfering through the `sz' or `rz' is plausible, though. But I cannot get
around the terminal issue ...

Thanks,
Yubin

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Yubin Ruan
In reply to this post by Jeff Lane-2

On Mon, Jul 17, 2017 at 02:28:20AM +0000, J wrote:

> On Sun, Jul 16, 2017 at 20:36 Yubin Ruan <[hidden email]> wrote:
>
> > 2017-07-17 4:49 GMT+08:00 Colin Law <[hidden email]>:
> > > On 16 July 2017 at 17:15, Yubin Ruan <[hidden email]> 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.
> > >>
> > >> 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.
> > >
> > > You have not said whether you can access the local machine from B.
> > > Also can you access A from B and can you access local m/c from A?
> >
> > Sorry for that.
> > I cannot access the local machine from either B or  because my local
> > machine is behind a NAT. I can access A from B but I don't have write
> > permission on A (I don't own A. A is used as a relay, so you cannot do
> > much on A).
>
>
> How about sshuttle? Running sshuttle to connect to A will create a VPN
> connection via ssh and will set up routes so you should then be able to scp
> from B to Local.

Wow sshuttle is great. I was not aware of that ;-) Thanks.

But, it turns out that I cannot execute any command except `ssh' on remoteA. I
think that is because remoteA is used as a relay and people block it. As a
result, when using sshuttle, I am able to log into remoteA but fail to
establish the VPN connection (cannot execute the python interpreter on
remoteA).

As I said in another reply in this thread, using direct transfer through the
terminal with utils such as `sz' and `rz' would be plausible, but I cannot get
around the terminal issues.

Yubin

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Karl Auer
In reply to this post by Yubin Ruan
On Tue, 2017-07-18 at 18:17 +0800, Yubin Ruan wrote:
> Assuming that:
> > a) you can ssh from your system to machine A
> > b) you can ssh from machine A to machine B
> > c) you have credentials for machine B
> >
> > ... then you can set up a tunnel.
> >

> This seems perfect and I agree with your suggestion. But,
> unfortunately, as remoteA is used as a relay, tunneling is block on
> remoteA. I just cannot create a tunnel to remoteB on remoteA.

The solution requires nothing except the ability to ssh to remote A
from your system, and the ability to ssh from remote A to remote B.

Unless - and perhaps this is what you mean - sshd is configured on
remote A or remote B to not permit port forwarding.

If port forwarding is not forbidden, you should be able to tunnel to
remote B as described. And you can do this using ONLY ssh on the
systems - yours, remote A and remote B.

Another possibility is to use script on your system. run script, log n
to A, log in to B, cat the file, log out of remote B, log out of remote
A, exit from script. Your entire session, including the catted data,
will be in a file called typescript in your current working directory.
You can edit it to remove the unwanted bits. This may not be useful if
the file you need is binary :-(

Regards, K.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer ([hidden email])
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: A52E F6B9 708B 51C4 85E6 1634 0571 ADF9 3C1C 6A3A
Old fingerprint: E00D 64ED 9C6A 8605 21E0 0ED0 EE64 2BEE CBCB C38B



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Joel Rees
In reply to this post by Xen
On Mon, Jul 17, 2017 at 8:07 PM, Xen <[hidden email]> wrote:

> Karl Auer schreef op 17-07-2017 12:41:
>>
>> On Sun, 2017-07-16 at 18:45 +0200, Xen wrote:
>>>
>>> What SSH really misses is a way to "get" a file where you are.
>>
>>
>> Isn't scp exactly that? If you have ssh access to  system, you have scp
>> access to it (modulo file permissions at each end of course).
>>
>> Having that built into ssh itself would IMHO break the model of "do one
>> thing well".
>
>
> I know and I guess you can always find the client with $SSH_CLIENT (didn't
> know that at first) but otherwise it can be a bit annoying.
>
> In other words, you *can* copy back to $SSH_CLIENT but of course it needs
> another login.
>
> Personally I wouldn't mind a little more "flesh" to the whole SSH thing, but
> whatever.
>
> The X protocol allows for this, you know. But without X, you are the
> proverbial 'screwed' for instance in terms of copy and paste.
>
> So you can.... you can run a GVim session even from Windows (using XMing)
> and you well have copy and paste just fine (honestly, it works) but in raw
> terminals using regular Vi you are stuck with plain copy and paste using
> text selection in the terminal window???
>
> I wish we had that thing for regular Vim.
>
> X-forwarding also works with a tunnel but yeah. PuTTY clients and other
> clients can set it up automatically.
>
> But I don't like GVim and it looks bad in a window on Windows at least. So
> this very simple thing, we don't have?

I think you want kermit:

https://en.wikipedia.org/wiki/Kermit_(protocol)

http://www.kermitproject.org/

apt-cache search kermit

Whether it would help the OP or not, I don't know. Haven't used it in
a really long time. I probably should check it out, except scp does the
job nicely enough for me, and I think tunneling should take care of the
OP's needs here.

--
Joel Rees

One of these days I'll get someone to pay me
to design a language that combines the best of Forth and C.
Then I'll be able to leap wide instruction sets with a single #ifdef,
run faster than a speeding infinite loop with a #define,
and stop all integer size bugs with my bare cast.
http://defining-computers.blogspot.com/2017/06/reinventing-computers.html

More of my delusions:
http://reiisi.blogspot.com/2017/05/do-not-pay-modern-danegeld-ransomware.html
http://reiisi.blogspot.jp/p/novels-i-am-writing.html

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Yubin Ruan
In reply to this post by Karl Auer

On Tue, Jul 18, 2017 at 12:54:37PM +1000, Karl Auer wrote:

> On Tue, 2017-07-18 at 18:17 +0800, Yubin Ruan wrote:
> > Assuming that:
> > > a) you can ssh from your system to machine A
> > > b) you can ssh from machine A to machine B
> > > c) you have credentials for machine B
> > >
> > > ... then you can set up a tunnel.
> > >
>
> > This seems perfect and I agree with your suggestion. But,
> > unfortunately, as remoteA is used as a relay, tunneling is block on
> > remoteA. I just cannot create a tunnel to remoteB on remoteA.
>
> The solution requires nothing except the ability to ssh to remote A
> from your system, and the ability to ssh from remote A to remote B.
>
> Unless - and perhaps this is what you mean - sshd is configured on
> remote A or remote B to not permit port forwarding.

Yes, I think so, unfortunately...
 

> If port forwarding is not forbidden, you should be able to tunnel to
> remote B as described. And you can do this using ONLY ssh on the
> systems - yours, remote A and remote B.
>
> Another possibility is to use script on your system. run script, log n
> to A, log in to B, cat the file, log out of remote B, log out of remote
> A, exit from script. Your entire session, including the catted data,
> will be in a file called typescript in your current working directory.
> You can edit it to remove the unwanted bits. This may not be useful if
> the file you need is binary :-(

They are not binary, but they are a few Gb large... :-(

Yubin

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transfer file from remote machine to local machine

Colin Law
On 18 July 2017 at 21:36, Yubin Ruan <[hidden email]> wrote:
>
> On Tue, Jul 18, 2017 at 12:54:37PM +1000, Karl Auer wrote:
>> On Tue, 2017-07-18 at 18:17 +0800, Yubin Ruan wrote:
>> > Assuming that:
>> > > a) you can ssh from your system to machine A
>> > > b) you can ssh from machine A to machine B
>> > > c) you have credentials for machine B

Something like this may work for you

ssh userA@A "ssh userB@B 'cat /path/to/file'" > somefile

With ssh access using keys that works, not sure how it will go if you
need to specify passwords.

Colin

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Loading...