Create a SSH key

The first step to being able to launch a cluster, where we can run our CFD codes is to create a SSH key for the region we’ll be using. This is possible via the EC2 console (under key pairs), but in this case we’ll show how this can be done using the AWS CLI. Please see here for more details.

For this workshop we’ll make use of the AWS CloudShell using the following commands. This is done on a per region basis e.g. if you are logged into Ireland, this key will be for Ireland only. You would need to repeat this step for different regions in the future.

You can launch the AWS CloudShell by clicking the icon in the top right as indicated in the picture below

ssh-1

Create a SSH Key, using a memorable name such as “cfd_ireland” (assuming you’re in the Ireland AWS region). Note the name of the SSH Key.

 aws ec2 create-key-pair --key-name cfd_ireland --query KeyMaterial --output text > cfd_ireland.pem

Modify the file permissions:

 chmod 600 cfd_ireland.pem

The ssh key is now ready to be used. Lets also download it to your own machine so you can in future login from there. Simply click the ‘Action’ button in the top right corner and select ‘Download’. You can then just type the name of the key as shown in the picture below.

ssh-2

Note that with AWS CloudShell you have a 1GB limit for storing files, so it’s best to only use it for temporary storage and to either download or store in S3 files you need for longer.