Last active
February 5, 2016 18:24
-
-
Save coyotebush/7ac9a43f9de2abd2871f to your computer and use it in GitHub Desktop.
SSH to lab workstations, even off campus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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