1Password on Mastodon

ssh-agent failing for Git

mpeppingmpepping
Community Member
edited October 2022 in SSH

Just switched to SSH keys in 1Password. All works well, except for any Git pull/push commands for SSH remotes.

To resume what does work:

  • ssh to any host. Using the IdentityAgent ~/.1password/agent.sock IdentityAgent and keys in 1Password
  • ssh -T [email protected]
  • GIT_SSH_COMMAND="ssh -i ~/some-key" git pull

What doesn't work:

  • git pull .. throws a "fatal: Could not read from remote repository"

I do get the 1Password authentication prompt. This is on Fedora 36 with git-2.37.3.

EDIT: Running GIT_SSH_COMMAND="ssh -v" git pull gave the answer for me. Will leave it here for anyone also facing the same issue. In my case an other SSH key (with very limited permissions to the git repo) was also loaded by the 1Password SSH agent. This key was offered first during authentication. So, being able to EXCLUDE certain SSH-keys from the 1Password SSH-agent would be a great addition to this functionality.


1Password Version: 8.9.4
Extension Version: Not Provided
OS Version: Fedora 36
Browser:_ Not Provided

Comments

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file