Skip to content

Instantly share code, notes, and snippets.

@coyotebush
Last active February 5, 2016 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coyotebush/7ac9a43f9de2abd2871f to your computer and use it in GitHub Desktop.
Save coyotebush/7ac9a43f9de2abd2871f to your computer and use it in GitHub Desktop.
SSH to lab workstations, even off campus
#!/bin/sh
# adapted from: http://superuser.com/a/827803/94698
if /sbin/ifconfig -a | grep -q 'inet 129\.65\.'; then
exec nc $1 $2
else
exec ssh -xaqW $1:$2 csc
fi
host csc
hostname unix12.csc.calpoly.edu
user USERNAME
ControlMaster auto
ControlPersist 15m
ControlPath ~/.ssh/mux-%r@%h:%p
Host 12?x?? 23?x?? 25?x?? 30?x?? cslvm??
hostname %h.csc.calpoly.edu
User USERNAME
ProxyCommand cscproxy %h %p
ServerAliveInterval 60
TCPKeepAlive yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment