When you have more than one private key, you need to specify the add the alternate key for authentication. The preferred method is to do a:
However in certain cases, you may need to do this for each session. Or there may be cases where you dont have access permissions to execute this file on the server. In such cases, you can directly add the key to the agent by adding the paramters for the key to a file ~/.ssh/config. Create this file if it doesnt exist.
In the file, add the following line and modify it as per the key file path for your private key:
IdentityFile ~/.ssh/id_dsa_xda IdentityFile ~/.ssh/sourceforge_droidzonedroidzone
Here, two keys are being added to the client.
The third way is to specify the keyfile with the ‘-i ‘ option while sshing or doing an scp. Tedious, and can be overcome by the method described above.
Note that after copying any key into .ssh/, you have to disable read/write access to the group and others by:
chmod 600 ~/.ssh/keyfile
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.