Creating SSH key pairs
To topPlease check out the related KB article HERE on how to create a new SSH key pair on various operating systems.
Copying/Installing keys onto SCIAMA (with access)
To topNow that you have created a private and public key you need to copy the public key onto Sciama using your existing access. Use the command :-
scp <path to your pub key> <username>@login4.sciama.icg.port.ac.uk:~/new_key.pub
ssh <username>@login4.sciama.icg.port.ac.uk 'cat ~/new_key.pub >> .ssh/authorized_keys'
You should see output similar to if you log into this login node for the first time:-
RSA key fingerprint is SHA256:zELprgvBZmyQRQ5/6/a58e3e660bR3lJZItu18pnZcg.
Are you sure you want to continue connecting (yes/no)? yes
Now try logging into the machine, with:
ssh <username>@login4.sciama.icg.port.ac.uk
You will be prompted for your pass phrase:-
Last login: Sat Apr 28 17:28:18 2018 from host.somewhere
and check to make sure that only the key(s) you wanted were added to your authorized_keys file in your $HOME/.ssh folder on the TARGET machine i.e. in this case the login server:
In the output, you should find all the public keys of the rsa keys you added (plus in case of SCIAMA one Alces public key needed for maintenance). You can compare them with the content of the $HOME/.ssh/id_rsa.pub file on the machines you log in from.
Now try logging in using your new key … you should now be asked for your passphrase and then successfully being logged in.
Using SSH key agents
To topIf you don’t want to enter the passphrase each time you can start an ssh agent that will do it for you. As an example, on your Linux desktop :-
ssh-add
Enter passphrase for $HOME/.ssh/id_rsa:
Every time the agent is restarted (e.g. after a reboot) the keys will need to be re-added.
Other operating systems also provide similar key management software (e.g. PuTTY’s pageant
tool).