Chapter 4: Working Remotely from Outside the College

Connecting from outside the College

face Josiah Wang Tom Crossland

In order to SSH from outside the college, you will need access to either a Linux machine, a macOS machine, or a Windows machine with a terminal emulator of some kind.

On Linux or macOS, simply open a terminal, and SSH using the ssh command as we did earlier.

On Windows, you can download PuTTY (or the slightly more up-to-date KiTTY), or use the Windows Subsystem for Linux (WSL) if you are on Windows 10 or higher (which can be done straight from the Microsoft Store). You can find guides for installing and using these online.

SSH from Outside College

Try to SSH to one of the lab machines – say texelNN.doc.ic.ac.uk, choosing a random NN from 01-44 (note that we’ve included the full address here). If you are not on Imperial College’s network, this should fail.

username@MACHINE:~$ ssh texel07.doc.ic.ac.uk

It fails because the department computers are all behind a firewall, and cannot be connected to directly. In order to connect to DoC computers via SSH, you must first login to an (aptly named) “login node”. These are special machines whose job is to manage connections into the college network.

These login nodes are:

  • shell1.doc.ic.ac.uk
  • shell2.doc.ic.ac.uk
  • shell3.doc.ic.ac.uk
  • shell4.doc.ic.ac.uk
  • shell5.doc.ic.ac.uk

It doesn’t matter which one you use – just pick your favourite number! Just so long as we don’t have everyone using a single login node, we’ll be fine…

If you are using a command line (either from Linux, macOS, or WSL), you should do something like the following to log in:

name@HOME:~$ ssh USERNAME@shell1.doc.ic.ac.uk
# You will be asked for your password here
username@vm-shell1:~$

Note that you must specify your username when logging in from outside the network.

If you are using an emulator like PuTTY, the process will look a little different, but eventually you will end up with a command prompt on one of the login nodes.

You can then connect to one of the lab machines from the login node! Just SSH as we did previously (you don’t even need the full address of the machine). Pick one of the login nodes (shell1 to shell5), and then any lab machine you like – log into the one you were using in the lab session, if you like.

name@HOME:~$ ssh USERNAME@shell1.doc.ic.ac.uk
username@vm-shell1:~$ ssh oak07
username@oak07:~$ 

Note that you must NOT run complicated or intensive processes on these shell servers. They should only be treated as gateways to the internal lab machines. CSG wil be after you otherwise!

Try doing something on the machine you’re connected to! (e.g. ls, or cd around your files a little)

username@vm-shell1:~$ ssh oak07
username@oak07:~$ ls
username@oak07:~$ cd ~/modules/shell

To logout of the machine, and return to the login node, you can use the logout command (like you used to log out of your neighbour’s computer in the lab session):

username@oak07:~$ logout
username@vm-shell1:~$

The Computing Support Group (CSG) in the department have a more complete guide on connecting to DoC systems remotely.

And there you go! That’s how we can run code and access DoC systems remotely.