Add the following in ~/.ssh/config:
Host git.droidzone.in Hostname git.droidzone.in User git IdentityFile ~/.ssh/id_rsa_mypvtkey
Note that the “Host” line is important, and cannot be just about any string (for git. For ssh it didnt matter). I found that git would ask me for a password if the Host line was something other than the actual hostname, even if the “Hostname” line was correct.
So, Host and Hostname should be the server address (name or IP)
If the ‘config’ file contains the proper lines, ssh-add isnt required.
Now add the key to ssh:
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.