> On May 22, 2020, at 3:35 AM, Stuart Henderson <s...@spacehopper.org> wrote: > > On 2020-05-21, Paul Suh <pl...@goodeast.com> wrote: >> 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. > > See IdentitiesOnly. > >> 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. > > You may find it useful to set Host blocks in .ssh/config with > IdentityFile, e.g. (untested but I think it's right): > > IdentitiesOnly yes > > Host bitbucket-foo > User git > HostName bitbucket.org > IdentityFile ~/.ssh/bb-foo.ed25519 > ControlMaster auto > ControlPersist 30 > ControlPath /tmp/ssh.bitbucket-foo > > Host bitbucket-bar > User git > HostName bitbucket.org > IdentityFile ~/.ssh/bb-bar.ed25519 > ControlMaster auto > ControlPersist 30 > ControlPath /tmp/ssh.bitbucket-bar\
Stuart, Thanks for you kind assistance. Do these go into the .ssh/config file on my local host (where I’m physically typing), on the server that I’m connected to, or both? I haven’t used the ControlMaster option before. —Paul
smime.p7s
Description: S/MIME cryptographic signature