[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: SSH
- From: Cameron Simpson <cs zip com au>
- To: redhat-install-list redhat com
- Cc: bruhwel jlab org
- Subject: Re: SSH
- Date: Fri, 1 Jun 2001 11:15:25 +1000
On Thu, May 31, 2001 at 03:51:55PM -0400, Krister Bruhwel <bruhwel jlab org> wrote:
| Does anyone know how to scp thru a machine. I can use "ssh -t mach1 ssh
| mach2" to ssh thru a machine. I would like to do something like that
| with scp.
| If another newsgroup would be better, please tell of it.
Short answer: to can't do it like the ssh line you describe.
Middle anser: you can half do it.
Cunning answer: you can do it in full with a port forward (I do this at home).
details after the "Middle Answer".
Middle Answer
=============
This will do it:
ssh mach1 ssh mach2 cat file >local-file
You could write a script you do it, too, but it will be a real pain to
support all the frills of a proper scp (-r -p etc etc).
If you have to copy more than a single file you're best using an archive
program like tar or a tool like rsync. You can then:
ssh mach1 ssh mach2 tar cf - lots-of-stuff | tar xvf -
or
tar cf - local-stuff | ssh mach1 ssh mach2 tar xvf -
Cunning Answer
==============
Arrange a stable ssh connection to mach1 with a port forward to mach2:
ssh -f -L 2022:mach2:22 mach1 'while sleep 60; do :; done'
Make a Host record in your ~/.ssh/config:
Host mach2viaMach1
Hostname mach1
Port 2022
Then you can go
ssh mach2viaMach1
or
scp mach2viaMach1:file blah
Effectively you're letting mach2's sshd listen for connections on port 2022
on your local machine.
This works really well.
--
Cameron Simpson, DoD#743 cs zip com au http://www.zip.com.au/~cs/
If you pick up a starving dog and make him prosperous, he will not bite you.
This is the principal difference between a dog and a man. - Mark Twain
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]