1Password SSH Agent how to set specific ssh key

stonesbg
stonesbg
Community Member
edited January 4 in SSH

I have a few different ssh keys that are used for git and would like to have it set so that if going through one github organization i force one key if going to a personal account it uses a different key.

Is there any way as part of the IdentityAgent to specify the appropriate key or is the option just to keep cycling through the prompts for ssh keys?


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser: Not Provided

Comments

  • Michael Mercurio
    Michael Mercurio
    Community Member

    You can specify which key to use for which host in ~/.ssh/config using IdentityFile option, where the identity file is the public key to use and the private key is stored in 1Password. You may also need to specify IdentitiesOnly yes.

    Example for user99@example.com:

    Host example.com
        User user99
        IdentityFile ~/.ssh/identity.pub
        IdentitiesOnly yes
    

    More here:
    https://linux.die.net/man/5/ssh_config