HPC@CSM Multistage Tunneling

One way to get files to your local
machine is to use a two  stage tunnel. 

This works on my home linux box but
for Windows it will be a bit different.

Here is my .ssh/config file...

joeminer@gray:~/.ssh; cat config
ForwardAgent yes

#the next two lines cause an error on some machines
#ControlMaster auto
#ControlPath   /home/joeminer/.ssh/tmp/%h_%p_%r

Host step1
Hostname imagine.mines.edu

Host step2
ProxyCommand ssh  step1 nc 2>/dev/null bluem.mines.edu 22

Host golden
ProxyCommand ssh  step2 nc 2>/dev/null aun.mines.edu 22

Host energy
ProxyCommand ssh  step2 nc 2>/dev/null  mc2.mines.edu 22

With this config file in place I can ssh directly from my home box to
aun or mc2 via a tunnel.  (I use golden or energy for the dummy
machine name instead of aun or mc2 just to remind me what I am
doing. This should work if you use aun or mc2.)  You will need to
change the ControlPath line given above or you can just leave that
line and the one above it out.

Assume that I want to copy the file example.tgz from aun (golden)

In one window on my home box I do the following:
joeminer@gray:~; ssh golden
Last login: Wed Oct  2 21:54:19 2013 from bluem.mines.edu
[joeminer@aun001 ~]$ ls example.tgz
[joeminer@aun001 ~]$ /opt/utility/tcpath example.tgz
[joeminer@aun001 ~]$


The command /opt/utility/tcpath gives me the path that
I am going to use to do the copy with golden as the "dummy"
name for the remote machine.

Then in the second window on my home box I do the following:

joeminer@gray:~/from_golden: scp
joeminer@golden:/u/pa/ru/joeminer/example.tgz .
100% 3549     3.5KB/s   00:00   
joeminer@gray:~/from_golden: ls -lt
total 4
-rw-r--r-- 1 joeminer users 3549 Oct  2 22:09 example.tgz

© 2018 Colorado School of Mines | | Equal Opportunity | Privacy Policy | Directories | Text Only | Mines.edu | rss

Last Updated: 03/16/2018 14:41:45