Using ssh keys, so you do not have to type your password
What is an ssh key
An SSH key is a secure, digital key used for authenticating and encrypting connections between computers over a network. Think of it as a special password that allows secure, remote access to another computer without needing to type a password each time.
Here’s a simple analogy: Imagine you have a locked door (your computer) and you want to allow a trusted friend (another computer) to enter without needing to give them your key each time (password). Instead, you give them a copy of a special, unique key (SSH key). Only this key can unlock the door securely.
In technical terms, an SSH key consists of two parts:
Private Key: Stays on your computer, never shared.
Public Key: Shared with the other computer you want to connect to.
When you attempt to connect to saga, the computer on the other side uses the public key to verify your identity through a secure process that involves both keys, ensuring a safe connection.
How to create one
You should have installed putty as described in the original document. PuTTY includes the PuTTYgen program:
This is what you see when it starts:
Out of the “Key” menu, click on “SSH-2 ECDSA”:
Then click on “Generate”, then move the mouse cursor within the empty square area:
After 10-20 seconds you will get something like this:
Please enter a password and verify it, in the following two boxes:
You can also use a “passphrase”, meaning, instead of a word with no spaces, you can use a line out of your favorite book or two, including spaces and punctuation.
Copy the text in the “Public key for pasting into OpenSSH authorized_keys file” and save it in a file called “id_ecdsa.pub” using notepad:
Click on “Conversions” and then on “Export OpenSSH key”:
Save the file as “id_ecdsa” with no extension
Click on “Save private key” and save it as “id_ecdsa”. The file created will be “id_ecdsa.pkk”
and you are done! Remember the location where you saved both files for our next section
Using the ssh keys
Copy the public key to saga
We need to create a directory and a file in saga:
log into saga.
mkdir ~/.ssh; chmod 700 ~/.ssh; touch ~/.ssh/authorized_keys; chmod 600 ~/.sssh/authorized_keysOpen your gitbash on your computer
Copy over the keys
Import the key into PuTTy
Open PuTTY, under “Saved Sessions” select “Default settings”, hit load
Select Connection -> SSH -> Auth -> Credentials -> Private key file for authentication -> browse
Open id_ecdsa.
You will be asked for the key you inserted. Type in the key.
Go back to Session on the top of the tree, on the left-hand side. click ‘save’ under the default session.
You are now ready to use your ss key