How to use SSH public key authentication

One of the ways to access a remote server is using a ssh with password and another cool way is to use public-key authentication where you don’t need to type a password along with that we store necessary details in ~/.ssh/config so that with minimal keystroke we will be able to access the remote server….