Create SSH keys for Login » History » Revision 3
« Previous |
Revision 3/12
(diff)
| Next »
Timo Eronen, 2016-05-04 08:02
Create SSH keys for Login¶
As an example we create keys for titan cluster.
Login to the computer from which you want to access the Cluster and change into directory ~/.ssh/
cd ~/.ssh/
If you don't have such directory, create it and change into it.
Create key pair using the following command.
DO NOT SETUP PASSPHRASE !!
ssh-keygen -f id_rsa_titan -t rsa
Now you have key pair:
- id_rsa_titan is your private key. Keep it secret.
- id_rsa_titan.pub is your public key.
Make sure the private key has the right protection:
chmod 400 id_rsa_titan
Send the public key (id_rsa_titan.pub) to the Cluster:
DO NOT SEND FILE id_rsa_titan WHICH IS YOUR PRIVATE KEY AND SHOULD BE KEPT SECRET.
scp id_rsa_titan.pub titan.utu.fi:
Login into titan.utu.fi and while logged change into directory ~/.ssh
cd ~/.ssh/
a) If you have file named authorized_keys add contents of id_rsa_titan.pub at the end of authorized_keys
cat ../id_rsa_titan.pub >> ./authorized_keys
b) If you don't have file named authorized_keys rename id_rsa_titan.pub to authorized_keys and move it:
mv ../id_rsa_titan.pub ./authorized_keys
Logout from titan.utu.fi
Edit your local config file ...
emacs config
... and add the following lines:
Host titan User YOUR_USERID HostName titan.utu.fi IdentityFile ~/.ssh/id_rsa_titan
Replace YOUR_USERID with your user id in titan.
You setup is done now and you should be able to login:
ssh titan
Updated by Timo Eronen over 8 years ago · 3 revisions