Skip to content

SSH Clients and Keys

MacOS and Linux

On MacOS and your Linux distribution almost certainly include an ssh client (likely OpenSSH).

The default ssh configuration will create a hidden folder .ssh in a user's home drive e.g. /home/k1234567/.ssh

Keys on MacOS and Linux

To check if you already have a key or other ssh related files on the command line run: ls ~/.ssh

In the output below, two existing key pairs can be seen, id_dsa and id_rsa with their corresponding public keys id_dsa.pub and id_rsa.pub

1
2
3
$ ls ~/.ssh
authorized_keys  id_dsa      id_dsa.pub   config
id_rsa           id_rsa.pub  known_hosts

If you have a key pair you can go straight to add the public key to the e-Research portal below.

To create a new key use the command: ssh-keygen -t rsa

Warning

If you have an existing id_rsa file this is a destructive process and the file will be overwritten with the new key.

You can just press enter for the first question ("Enter file in which to save the key") and the key will be generated in the default location. Enter a strong passphrase for the second step.

Once you have created the key pair you can add the public key to the e-Research portal.

Windows

Keys on Windows

From Windows 10 there is a built-in SSH client and tools that work in a very similar way to OpenSSH on Mac OS and Linux. Open a command prompt and check you are in your home directory (usually C:\Users\<username>). Check if you already have a key or other ssh related files on the command line using: dir .ssh

In the output below, an existing key pair can be seen, id_rsa with the corresponding public key id_rsa.pub

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
C:\Users\k1234567>dir .ssh
 Volume in drive C has no label.
 Volume Serial Number is B2CF-F55B

 Directory of C:\Users\k1234567\.ssh

31/01/2022  18:32    <DIR>          .
31/01/2022  18:32    <DIR>          ..
31/01/2022  17:17             2,655 id_rsa
31/01/2022  17:17               567 id_rsa.pub
31/01/2022  18:33             1,424 known_hosts
               4 File(s)          7,886 bytes
               2 Dir(s)  377,673,068,544 bytes free

If you have a key pair you can go straight to add the public key to the e-Research portal below.

To create a new key use the command: ssh-keygen -t rsa

Warning

If you have an existing id_rsa file this is a destructive process and the file will be overwritten with the new key.

You can just press enter for the first question ("Enter file in which to save the key") and the key will be generated in the default location. Enter a strong passphrase for the second step.

Once you have created the key pair you can add the public key to the e-Research portal.

Add the public key to portal.er.kcl.ac.uk

Open https://portal.er.kcl.ac.uk/access/ssh add a key name and, on linux or mac, copy the output from: cat ~/.ssh/id_rsa.pub or, on windows, open the public key in a text editor and copy the contents into the SSH Key field.

Host fingerprints

1
2
3
4
5
6
7
bastion.er.kcl.ac.uk
SHA256: jd0e7dwNn09a3InzuyIM9sIXzmW3jAOn6A+uyAXGK38
MD5: 1a:4b:97:9d:40:bc:54:2c:21:b0:d0:d5:b4:7c:22:de

hpc.create.kcl.ac.uk
SHA256: dLuYMyZ5YWb9CmRvuZAorT17g1JgmyNw/Xn5oGkPZzg
MD5: 73:b5:d9:1d:75:08:c4:19:41:f4:05:54:67:8d:f1:23