The following steps describes how you generate a rsa key pair for public key authentication. You need access to the client and the server system.
Creating default directory for the user keys.
mkdir ~/.ssh
Generating key pair.
ssh-keygen -f ~/.ssh/id_rsa -t rsa
Change mode of created folder and files otherwise ssh wouldn't use it.
chmod -R 700 ~/.ssh
Copy the generated id_rsa.pub to server. E.g.:
ssh-copy-id ~/.ssh/id_rsa.pub user@server.example.org:
Congratulations,
Now your systems are ready to use public key authentication.