SSH To Machines Not Directly Accessible From Internet

For CS machines that are no longer directly accessible from the Internet (e.g. comps#, comps0-comps4), you can still log in to them via ssh, by relaying through another machine. Happily, this does not mean that you need to log in or type your password twice.

If you are using UNIX, Linux, Cygwin, or MacOSX, you can create an alias for logging in to a remote host via ssh. If the machine were directly accessible on the internet, if you were using tcsh or csh, you would normally create an alias in your .cshrc or .login file like this:

        alias apps0 ssh apps0.cs.toronto.edu

If you are using bash, you would normally create an alias in your .bashrc or .bash_profile like this:

        alias apps0='ssh apps0.cs.toronto.edu'

If the machine you want to reach (e.g. comps#) is not directly accessible on the internet, you can create a slightly more complicated alias that that automatically relays it through a machine (e.g. apps0) that is accessible. For example, if you are using tcsh or csh, you would create an alias in your .cshrc or .login file like this:

        alias comps# ssh -t apps0.cs.toronto.edu ssh comps#
If you are using bash, you would create an alias in your .bashrc or .bash_profile like this:
        alias comps#='ssh -t apps0.cs.toronto.edu ssh comps#'

Then simply type comps# and it will connect you to the comps machine, via apps0

(note: if you are currently using the '-X' or '-Y' option in your ssh command, you will still need it, next to the '-t'.)

If you are using MS Windows, here is how to do the same sort of thing with putty:

Each time you start up putty in future, you will see an "comps#" stored session, which you can start by simply double-clicking on it. This will connect you to comps#.

You can repeat the above steps for other servers that are similarly not accessible from the internet anymore; simply replace "comps#" in the steps with the name of your desired server. Also note that you do not necessarily need to relay only through apps0.cs.toronto.edu, any internet-accessible CS server will do.