I use multiple keys for different hosts, but I specify which key or "identity" to use in my ~/.ssh/config file on a per-host basis, e.g.:


Host myhost1
   IdentityFile ~/.ssh/six_dsa

Host myhost2
   IdentityFile ~/.ssh/half-a-dozen_dsa


Then, when I do "ssh myhost1", it will pick up the six_dsa file for the key, not a random one from the output of "ssh-add -l".

I can't spot anything in either ssh(1), ssh-add(1), ssh-agent(1) or ssh_config(4) man pages to say that the order in which keys are added is preserved, so I would suggest using the IdentityFile keyword in your config file to eliminate any guesswork that ssh has to do.

Regards,
Brian



jason wrote:
I am running into a problem with a ssh-add functionality in nevada b115.  I had 
a script that would do the following:

ssh-add ${HOME}/.ssh/*.[rd]sa

In previous versions of nevada, this would run fine, yet for b115, the order of files 
found via the ${HOME}/.ssh/*.[rd]sa is not kept.  This presents problems when ssh 
connections are made to other servers since the keys I want presented first, are not 
getting presented first.  This is confirmed when doing an "ssh-add -l".

Is there a way to control the key order so that the keys I want to have tried 
first, are used.  I thought that the order in which I added keys, would 
translate to the order in which those keys are presented to the remote server, 
yet it looks like this ordering is not kept.

Upon multiple tries of the "ssh-add ${HOME}/.ssh/*.[rd]sa" the results seem to vary.  I 
have to keep trying until I get the "ssh-add -l" to display the order I need.

Any insight would be greatly appreciated.

--
Brian Ruthven                                        Sun Microsystems UK
Solaris Revenue Product Engineering             Tel: +44 (0)1252 422 312
Sparc House, Guillemont Park, Camberley, GU17 9QG

_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to