obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

Adding ssh passphrase to obsidian md

Open Tom-there opened this issue 3 years ago • 12 comments

First of all not really sure if this is the right place to ask this, sorry if it isn't

So I just set up Obsidian git for my main Windows machine and my arch laptop, and on my windows machine it works perfectly, but since I have a ssh passphrase on my arch key the plugin gets denied permission, how do I fix this? (I read through the other issues already but didn't really understand the steps taken. My ssh agent is set up correctly, should I just generate a key without passphrase solely for obsidian?)

Tom-there avatar Jun 07 '22 11:06 Tom-there

Could you elaborate, on what point you get "permission denied" and if you have checked file permissions?

If permission on the key-file are not the cause of your problem, this ticket might be a duplicate of #118 .

HerrDings avatar Jul 04 '22 09:07 HerrDings

I think he means this message:

image

I get this because I can't fill in a ssh key phrase. Is there any way to solve this?

tintin10q avatar Aug 05 '22 12:08 tintin10q

I think he means this message:

image

I get this because I can't fill in a ssh key phrase. Is there any way to solve this?

I think I had the same problem, and I got around it by creating an SSH key without a passphrase. It's probably not ideal, but at least it works for now...

acmorse avatar Sep 08 '22 12:09 acmorse

Yes that is the message I meant. I guess that makes sense. I don't really want to make a key without a pass phrase though but it probably would be hard to detect? Anyway I think the best way to do it is to have a hotkey which when pressed asks for the passfhrase and then it is helt in memory until you restart.

tintin10q avatar Sep 08 '22 12:09 tintin10q

sorry for not checking the thread for so long... This is the exact error I meant, for now I created a ssh-key without a passphrase, so its working now

Tom-there avatar Sep 30 '22 12:09 Tom-there

Could you reopen this? Because it would still be nice if we were able to put a passphrase.

tintin10q avatar Oct 17 '22 14:10 tintin10q

I'm trying to summarize authorization instructions here. It may help you.

Vinzent03 avatar Feb 06 '23 22:02 Vinzent03

Does the plugin not work with ssh-agent?

kg4zow avatar Dec 09 '23 20:12 kg4zow

What is that?

tintin10q avatar Dec 11 '23 03:12 tintin10q

"What is that?" referring to ssh-agent?

ssh-agent is a process which holds secret keys in memory and uses them to process authentication requests. Any operation which needs a secret key and would normally prompt you for a passphrase, can be performed by ssh-agent instead.

For most people the attraction is that you only get asked for the key's passphrase once, when the key is added to the agent (which usually happens the first time you use a key after the ssh-agent process starts). In this case, once the secret key is in the agent, the ssh commands executed by git won't need to ask for a passphrase, because the agent will already have the key in memory, in a non-encrypted format.

There are other programs out there which speak the same protocol, and can perform the same operations using different mechanisms. For example, gpg-agent can emulate an SSH agent and use a GPG subkey to authenticate SSH connections. Even better, gpg-agent can work by talking to an external smartcard (or in my case, a YubiKey) which actually contains the secret keys and performs the crypto operations, without the keys ever leaving the card.

I could go on about this, but I don't have the time. If this is really new to you, you may need to spend some time with a search engine, or with the documentation for your SSH client.

kg4zow avatar Dec 11 '23 13:12 kg4zow

I'm also having the same issue. I have looked at the auth instructions (https://github.com/denolehov/obsidian-git/wiki/Authentication). I'm on MacOS. My terminal can access the repo in question without issue using my ssh key (key password is stored in the keychain). The gitconfig for the repo in question has:

[credential]
	helper = osxkeychain

Yet I still get:

image

Any suggestions as to what I might be doing wrong here?

jsco2t avatar Apr 16 '24 00:04 jsco2t

To be clear - I don't necessarily need a way to store my passphrase in Obsidian. I just need to work out why this plugin on MacOS seems to have issues accessing my credentials in the OSX Keychain.

jsco2t avatar Apr 16 '24 00:04 jsco2t