obsidian-git
obsidian-git copied to clipboard
Authentication issue with ssh passphrase
Hi,
I am getting the error message:

About my setup:
I have obsidian-git running on both my Mac and an Arch Linux install. It works great on Arch Linux, but I get the above error message on Mac whenever I start Obsidian. I use SSH to pull from Git, and I have two different SSH keys on my two machines. The key on my Arch Linux machine is not password protected, and my Mac's is. They are both added to ssh-agent and I have no problems pulling or pushing to git outside of this on either machine.
Happy to provide any more info. I checked the Issues and could not find any similar to mine. Thank you.
Same here, but Windows user. I'm using gitbash, works ok by command line.
Same issue on my end with Windows, I only have one ssh key linked to github, so maybe it needs to save the ssh password?
When you use your ssh key, you have to type in your ssh-key password right?
@Vinzent03 Whenever I open git bash, I:
- start the ssh-agent
- ssh-add the relevant keys + you get prompted for a password to type in here
- Do the usual git pull/add . / commit / push steps
I think if you don't add the ssh keys, then you get prompted for the password each time. Personally, I adjusted my ~/.bashrc file so that every time I open a git bash terminal I add my ssh keys + pw's at the beginning.
The problem is the passphrase . Will take a look how to solve this.
When you use the default terminal and start the ssh-agent and run ssh-add. And type in your passphrase. Does the issue still persist? I can't help more, because I am on Linux.
Using the git bash terminal, entering ssh-add and leaving it open while I run a git pull from Obsidian, I get the same error:

I haven't set it up using the Windows command terminal before, but maybe this link would help? https://stackoverflow.com/a/40720527
Well you have to tell me if this works. That has nothing to do with this plugin.
Running ssh-add resolved this for me. I am using macOS 11.3.1
@s-kyy, sorry I know this is closed but wondering what you did to prevent being asked every time rather than the first time when opening the terminal. Is there a way to check if the key has already been added?
@ZerkerEOD
Assuming you use Windows, and that you already setup your ssh keys I have two files in my ~/ user folder:
~/.bash_profile
# generated by Git for Windows
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
~/.bashrc (or ~/.profile):
eval `ssh-agent`
ssh-add
Then in the ~/.ssh/config file:
Host github.com #custom name for the host
HostName ssh.github.com #or other website directing to the host
User git #usually your username, but github ssh takes git as the username
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa #add your ssh-key file path
AddKeysToAgent yes
It's been a while since I modified this setup, but I think this is all you need. This would prompt a password (if there is one) for your ssh keys that you're adding every time you open git bash (linked to Git for Windows).
Hope it works for you.
was able to work around this by enabling Windows 11:s OpenSSH executable in git (re-running the installer, making sure to select Windows OpenSSH as the preferred version) and running the ssh-agent as a Windows service according to the guide here https://interworks.com/blog/2021/09/15/setting-up-ssh-agent-in-windows-for-passwordless-git-authentication/
Good luck everyone struggling and let me know if this works for anyone! :)
I ended up removing the passphrase. I know is not a good solution, but is a simple one.
ssh-keygent -p
Depending on your setup with Windows 10 you may need to add this via an elevated console, only if you're using OpenSSH for Windows
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
ssh-add also works in windows 11! I followed what exactly written over here. Thanks for all the information everyone.
I solved this problem by setting the default SSH user, in the ~/.ssh/config file:
Host *
User your_default_ssh_user
IdentityFile ~/.ssh/your_default_ssh_key
i am using manjaro and ssh-askpass not defined, but system used ksshaskpass. Im trying use alias, but this dont work. How to fix it.
upd: im fixed by setup to "Additional environment variables"
SSH_ASKPASS=/usr/bin/ksshaskpass // or you path