Logging into unix boks using public/private key encryption
===

I am trying to login to my unix box using a public key(XYZ). I found out that I have to create a pair of public and private keys and add the public key to my server from where I will be logging in. But I am actually trying to login to the server from a seperate tool. The tool is being deployed into a seperate server. So adding the public key to that server would solve my problem? Is there method other than this to do this?