ssh-keygen -t rsa
Press enter when it prompts for file location Enter a passphrase (simple one will do - it's only ever important if your private key (the one on your machine) gets compromised)
This will create a .ssh/
folder with two files - id_rsa
and id_rsa.pub
in your home directory.
and move it into .ssh directory as "authorized_keys" file (given you don't have ssh keys on the server already - if you do, you probably know how to just add the new key to the existing authorized_keys file):
ssh username@hostname.org mkdir .ssh;
scp ~/.ssh/id_rsa.pub username@hostname.org:~/.ssh/authorized_keys
ssh username@hostname.org
if you entered a passphrase for rsa keys, it will be prompted now
chmod 700 .ssh; chmod 640 .ssh/authorized_keys
Connect to the server as usual. You should be logged in directly.