Locked History Actions

Diff for "SshAccessFromOutsideGates"

Differences between revisions 3 and 4
Revision 3 as of 2013-02-22 03:01:56
Size: 2989
Editor: netj
Comment: adjusted heading level
Revision 4 as of 2013-02-23 07:33:58
Size: 3340
Editor: netj
Comment: Forgot to include the ProxyCommand none part. Changed default to whale as well.
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
# try to share connection across sessions to the same host ## InfoLab Servers (http://snap.stanford.edu/moin/InfolabServers)
# remote login servers, directly accessible from outside world
Host whale.stanford.edu shark.stanford.edu snap.stanford.edu skate.stanford.edu ilc0-ext.stanford.edu il-fs-1.stanford.edu bruce.stanford.edu
    ProxyCommand none
# and the rest that should go through one of the remote login server
Host il*.stanford.edu madmax*.stanford.edu rulk.stanford.edu hulk.stanford.edu rocky.stanford.edu rambo.stanford.edu bruce.stanford.edu zarya.stanford.edu eel.stanford.edu snap.stanford.edu shark.stanford.edu skate.stanford.edu whale.stanford.edu silk.stanford.edu
    ProxyCommand ssh -q ${CS_PROXY_HOST:-whale}.stanford.edu exec nc %h %p

## Share connection across sessions to the same host as much as possible
Line 14: Line 22:

# use remote login server for InfolabServers
Host il*.stanford.edu madmax*.stanford.edu rulk.stanford.edu hulk.stanford.edu rocky.stanford.edu rambo.stanford.edu bruce.stanford.edu zarya.stanford.edu eel.stanford.edu snap.stanford.edu shark.stanford.edu skate.stanford.edu whale.stanford.edu silk.stanford.edu xenon.stanford.edu
    ProxyCommand ssh -q ${CS_PROXY_HOST:-shark}.stanford.edu exec nc %h %p
Line 20: Line 24:
This will make all your ssh commands go through the remote login machine "shark" by default, and you don't have to worry about where you're accessing them from. This will make all your ssh commands go through the remote login machine "whale" by default, and you don't have to worry about where you're accessing them from.
Line 23: Line 27:
CS_PROXY_HOST=xenon ssh server ... CS_PROXY_HOST=shark ssh server ...
Line 28: Line 32:
ssh -o ControlMaster=no -o ProxyCommand=none server ... ssh -o ProxyCommand=none -o ControlMaster=no server ...
Line 30: Line 34:
rsync -e 'ssh -o ControlMaster=no -o ProxyCommand=none' ... server: rsync -e 'ssh -o ProxyCommand=none -o ControlMaster=no' ... server:
Line 32: Line 36:
scp -o ControlMaster=no -o ProxyCommand=none ... server: scp -o ProxyCommand=none -o ControlMaster=no ... server:

SSH Tricks for Accessing Infolab Servers outside the Gates Building

SSH Logins

Most of the InfolabServers are only accessible within the Gates building network or on-campus. There are remote login machines for accessing them from outside of Gates, or off-campus, but logging in twice is an annoyance, and makes life hard when copying files, etc. So, here's how you can configure your ssh to make it feel like directly accessing them regardless of your location.

If you're using a Mac or Linux machine, add the following lines to your ~/.ssh/config file:

## InfoLab Servers (http://snap.stanford.edu/moin/InfolabServers)               
# remote login servers, directly accessible from outside world
Host whale.stanford.edu shark.stanford.edu snap.stanford.edu skate.stanford.edu ilc0-ext.stanford.edu il-fs-1.stanford.edu bruce.stanford.edu                   
    ProxyCommand none 
# and the rest that should go through one of the remote login server
Host il*.stanford.edu  madmax*.stanford.edu rulk.stanford.edu hulk.stanford.edu rocky.stanford.edu rambo.stanford.edu bruce.stanford.edu zarya.stanford.edu eel.stanford.edu  snap.stanford.edu shark.stanford.edu skate.stanford.edu whale.stanford.edu silk.stanford.edu
    ProxyCommand ssh -q ${CS_PROXY_HOST:-whale}.stanford.edu exec nc %h %p

## Share connection across sessions to the same host as much as possible
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p

This will make all your ssh commands go through the remote login machine "whale" by default, and you don't have to worry about where you're accessing them from. When you need, you can specify a different remote login server on the fly over the CS_PROXY_HOST environment variable as follows:

CS_PROXY_HOST=shark  ssh server ...

When you want to transfer large amount of data directly from/to the server, you might want to bypass this proxy and session sharing configuration. You can either comment out the config lines above for a while, or disable those options with command-line arguments as follows:

ssh -o ProxyCommand=none -o ControlMaster=no server ...

rsync -e 'ssh -o ProxyCommand=none -o ControlMaster=no' ... server:

scp -o ProxyCommand=none -o ControlMaster=no ... server:

Hadoop Job/Task Tracker web UI

Access to the InfolabClusterHadoop's Job Tracker and Task Trackers' web interface is restricted to Gates network. However, you can access them from practically anywhere using SSH port forwarding as follows. Just add a local port forwarding option as you login to the node.

ssh iln29.stanford.edu -L50030:localhost:50030

Now you can access it via your http://localhost:50030.

However, this won't solve the problem of accessing individual Task Tracker logs. To have full access to them, you should enable SSH's dynamic forwarding as you login to the head node as follows:

ssh iln29.stanford.edu -D1080

And, set your browser's SOCKS proxy to localhost:1080.

References