In order to get to the login node "astro", you first have to go through the gateway. This is
a bit of a pain. But if you want to copy a file from your local machine to astro you will
find it impossible; you cannot store the file temporarily on the gateway, as you have no
space allotted there!
The solution is to set up a tunnel through the gateway directly to astro. We will accomplish
this using port forwarding in your ~/.ssh/config coupled a background connection to the
gateway.
Note in addition to the following you still need to ssh keys on astro and
start your local ssh-agent. Otherwise you'll always be typing your password.
Download this this script, put it somewhere on your path, and make it executable. You
will then be able to start, stop, and restart the connection using the following commands:
setup-astro start # start the connection
setup-astro stop # kill the connection if one exists
setup-astro restart # kill the connection if one exists and start a new one
Port forwarding will allow you to log straight into the astro login node by tunneling
through the gateway connection. Also, we will create an alias that allows us to refer
to the astro login node by a short name "tastro" without qualifying the port we have forwarded.
Copy this config into your ~/.ssh/config
Once you have copied the config into your personal ~/.ssh/config, you can refer to the
login node as "tastro".
# set up the connection
setup-astro start
# log into astro.rcf.bnl.gov
ssh tastro
# you can also scp or rsync through the gateway
scp local_file tastro:
rsync -av tastro:tmp/ .