This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

ssh-xfer: Quickly grabbing files over an existing SSH connection

Posted by: Anonymous [ip: 199.18.139.129] on August 22, 2008 07:52 PM
boxB# ssh boxA
....
boxA#
~C
>-L5000:localhost:5000

boxA# uuencode -m some-file-or-files | nc -l -p 5000
~^Z
boxB# nc localhost 5000 | uuencode -m -c

I fabricated this log, but I do something similar to this from time to time.
It's easy to see how additional hops could be handled in this way, and
how furthermore a simple shell script could automate much of the session
set up and provide a front-end so that port numbers don't need to be
remembered. It'll do in a pinch anyway and it's as portable as you like.

Consider that something which does this more elegantly would be very
valuable in situations where login requires some token (OTP), and the
overhead of establishing a new session, keying and diffie is a little much
to just copy a few files..

tar is your friend too. The only difference between this and the previous
helpful comments is that it does not involve copy and paste...

Thanks

#

Return to ssh-xfer: Quickly grabbing files over an existing SSH connection