Skip to content

Generating SSH keys

SSH keys are used to securely connect to the CSCTCloud server using public key authentication. You'll need to create keys on any computer you wish to use the server from before being able to connect to it.

Generating keys

Keys are generated by running the ssh-keygen program in a terminal window, this program is normally already installed on most operating systems, but if it's not available it can be added by installing OpenSSH.

Create a new keypair

Run the following command in a terminal window to create a new public/private keypair:

ssh-keygen -t rsa

The command will ask you a few questions: the location to save your keys, and for a security passphrase.

Info

With this command we're specifying we want to use the rsa public key algorithm. There are other public key algorithms we could use such as ecdsa and ed25519 - you can choose to use one of these if you wish, but it will change some of the commands used later on to connect to the server.

Where to save your keys

Save your keys to the default suggested location for your operating system, you can choose the default location (shown in the brackets) by pressing Enter when prompted to enter a file:

Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\<username>/.ssh/id_rsa):
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/<username>/.ssh/id_rsa):
Generating public/private rsa key pair.
Enter file in which to save the key (/home/<username>/.ssh/id_rsa):

UWE lab computers

If you're working on a UWE lab computer you'll need to copy your keys to OneDrive after creating them. Finish creating your keys and then follow the instructions for this below.

Setting a passphrase

The command will ask you to enter a passphrase. You could leave this empty, but for security reasons we recommend you enter a memorable passphrase to protect your keys from unauthorised use.

Enter passphrase (empty for no passphrase):
Enter same passphrase again:

Warning

When you type in a passphrase you won't see any characters appear on the screen - this is normal! Keep typing and press Enter when you have finished entering your passphrase.

Storing keys in OneDrive

If you're working on a UWE lab computer you'll need to copy your keys to OneDrive, otherwise they won't be accessible on other lab computers and you'll need to follow these steps again to create a new set of keys.

To copy your SSH keys to OneDrive open PowerShell and run

Copy-Item -Path "$env:USERPROFILE\.ssh\*" -Destination "$env:USERPROFILE\OneDrive - UWE Bristol\.ssh" -Recurse

When connecting to the server and setting up Visual Studio Code on a UWE lab computer, you'll need to use slightly different commands to refer to this OneDrive location to be able to connect.