When we try to ssh one server to another server, It always require password.
With a help of OpenSSH package, We can generate authentication keys on local machine and copy public key to the remote server.
Generate a key pair on the local server
Use ssh-keygen to generate authentication keys for SSH.
$ ssh-keygen
Install your public key on the remote server
$ ssh-copy-id -i ~/.ssh/id_rsa.pub UserName@RemoteServer
Add a private key to the authentication agent on the local server
Use ssh-add to add identities to the ssh-agent – the authentication agent.
$ ssh-add
Now, you can log into the remote server via the SSH without a password.