Considering situation where we need to connect from Server A to Server B
On Server A, run the below command to generate the public key
ssh-keygen -t rsa
Note: If you don’t have ssh-keygen command recognized in your system, install Git – which will provide required file for running ssh-keygen command.
After installing Git, add this/similar path to your system environment variable C:\Program Files (x86)\Git\bin\ssh-keygen.exe
This command should generate id_rsa.pub file in your <homedir>/.ssh/ directory
On Server B
create a folder in the <homedir> with name .ssh
Copy the id_rsa.pub file from Server A, into this .ssh directory.
Append the contents of id_rsa.pub file to authorized_keys file inside the .ssh directory on Server B. If one authorized_keys file does not exist – create it.
That’s it! now we should be able to login without having to enter password every single time.