Using Windows? See this article.
Using an SSH key allows you to connect to a server without the need to provide a password. An SSH key is actually comprised of a public and private key pair. A copy of the public key is placed on a server you wish to access whereas the private key should never be distributed and remains only on your machine. Treat a private key like a password - don't share it!
1. Check if you already have an existing SSH key on your system. On Mac (Terminal app) or Linux, go to the command line and type:
ls -al ~/.ssh
2. If you don't have a directory named ~/.ssh or the keys above don't exist yet, here's how to generate a new key pair:
ssh-keygen -t rsa -b 4096 -C "firstname.lastname@example.org"
Although it is a convention, you can use any value in place of the email address.
You will be asked for a passphrase, which is used to protect your private key.