Folks, 

I’m not sure this is the right place to ask, but I hope someone can point me in 
the right direction. 

When using ssh with keys that are in files on the local host, you can specify 
which key is used for the connection by using the -i option and giving the path 
to the key file. 

However, if you are loading multiple keys into ssh-agent and forwarding keys to 
other hosts, there doesn’t seem to be a way to select which key will be 
presented to the destination by the ssh client. The -i option does not find the 
original key file of course (since it’s on another machine) and there doesn’t 
seem to be an option to tell ssh-agent which key to present. 

The particular case I’m working with is using git with bitbucket.org, where 
user accounts are identified by the key. I have two accounts that have two 
different keys, and when I’m logged into another server via ssh I can only 
access one BitBucket account since that’s the one whose keys ssh-agent presents 
first. 

I can think of a couple of workarounds, but I also wanted to see if I’m missing 
something. 


—Paul

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to