Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unable to auth to Github via ssh on MacOS using 1password ssh-agent #824

Open
liftconfig opened this issue Dec 8, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@liftconfig
Copy link

Describe the bug

  • .ssh/config is correctly configured to use 1password ssh agent:
    Host *
    IdentityAgent "~/Library/Group Containers/xxxxxxxxx.com.1password/t/agent.sock"

  • Output of ssh-add shows correct ssh key:
    SSH_AUTH_SOCK=~/Library/Group\ Containers/xxxxxxxxx.com.1password/t/agent.sock ssh-add -l

  • Access to repo via git cli works

  • Running git operations on same repository within Obsidian causes permission error

Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)

[email protected]: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Steps to reproduce

Using Git in Obsidian to try and access remote github repository via ssh while using 1password ssh-agent

Expected Behavior

No response

Addition context

No response

Operating system

macOS

Installation Method

Other

Plugin version

2.30.1

@liftconfig liftconfig added the bug Something isn't working label Dec 8, 2024
@Vinzent03
Copy link
Owner

I guess you have some setup for your ssh-agent in your .bahsrc, .zshrc or similar. Could you share that? These scripts only affect your shell and not Obsidian (unless you start Obsidian from the terminal, in that case it should work).
For now, I suggest you to set the SSH_AUTH_SOCK env variable yourself in the plugins settings.

@liftconfig
Copy link
Author

Setting env var SSH_AUTH_SOCK="~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock" in the plugin or launching Obsidian from terminal didn't resolve the issue. I edited the remote (option: Git: Edit Remotes) and changed the remote from ssh to https as a work around.

@Vinzent03
Copy link
Owner

Could you try it without the quotes? And maybe try replacing the ~ with I guess /home/<your-username>, but I'm unsure there.
SSH_AUTH_SOCK=/home/<your-username>/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock
And share any errors you might encounter, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants