Use key-based authentication with SSH

It’s really simple to login with your username/password combination on the remote machine, but sometimes it can be a better idea to use key-based authentication.

Key-based authentication is where instead of authenticating that you are you with the remote machine credentials, you use a cryptographic key pair.

This tutorial assumes you’re using a Unix-like ,operating system on both the local and remote machines which both run OpenSSH. First, on your local machine, fire up a terminal and enter the following:

$ ssh-keygen -t rsa

Rest Here.