Forum Discussion

Former Member's avatar
Former Member
3 years ago

SSH not using 1Password Agent unless SSH_AUTH_SOCK set

So I've been trying to use SSH Keys via 1password as opposed to having them physically on my device.

I've gone through the process of setting up all of this in accordance to the documentation. From my understanding, there's 3 options for this to work, IdentityAgent, IdentityFile or SSH_AUTH_SOCK, and each option can work independently.

So in my case I've opted for IdentityAgent with my ~/.ssh/config looking like so

Host work-github
HostName github.com
User git
IdentityAgent "~/Library/Group Containers/<random alphanumeric>.com.1password/t/agent.sock"
IdentityFile none

My SSH Keys is stored in a folder called Work and so accordingly I'm modified the agent toml appropriately.
toml
[[ssh-keys]]
item = "M2 SSH Key"
vault = "Work"

Also, I've made sure to add my public key to Github as the guide instructs.

Now whenever I attempt to clone, push etc. Nothing works I'm given the following error
```

git clone mailto:git@github.com:/.git
Cloning into ''...
mailto:git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
```

Running ssh -vT git@github.com notably shows:

debug1: get_agent_identities: bound agent to hostkey
debug1: get_agent_identities: ssh_fetch_identitylist: agent contains no identities

Which perplexes me even further.

In order to get this to work, I need to set the environment variable SSH_AUTH_SOCK, every-time I'm in a new terminal instance.

Is there something I'm misunderstanding about how this all works, cause I thought setting IdentityAgent would be good enough. Any ideas?


1Password Version: 8.10.9 (81009046)
Extension Version: Not Provided
OS Version: 13.5.1 (22G90)
Browser: Not Provided

1 Reply

  • Former Member's avatar
    Former Member

    This discussion can be closed, my Host was incorrect