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

[Bug]: ssh_askpass: exec(/usr/X11R6/bin/ssh askpass): No such file or directory Permission denied, please try again.

Open emign opened this issue 2 years ago • 1 comments

Describe the bug

After changing my remote origin from https to ssh (same repo), I get the attached error message.

Using git push via terminal in the same directory works as intended.

Relevant errors (if available)

ssh_askpass: exec(/usr/X11R6/bin/ssh
askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/X11R6/bin/ssh
askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/X11R6/bin/ssh
askpass): No such file or directory
[email protected]:
Permission denied
(publickey,password).
fatal: Could not read from remote
repository.
Please make sure you have the correct
access rights
and the repository exists.

Steps to reproduce

chose git backup or git push from the git plugin

Expected Behavior

No response

Addition context

No response

Operating system

macOS

Plugin version

1.26.1

emign avatar Jul 16 '22 00:07 emign

A workaround it to just link your ssh-askpass to the location that obsidian-git is looking at.

sudo ln -s $(which ssh-askpass) /usr/X11R6/bin/ssh-askpass

if you don't have a ssh-askpass executable then you might need to install it through brew, I'm not sure if it comes pre-installed. This worked for me on Mac M1 12.4

archer31 avatar Jul 18 '22 17:07 archer31

Mine is giving this error with ksshaskpass, but my file exists in the folder.

NaBuchholz avatar Dec 07 '22 10:12 NaBuchholz

A workaround it to just link your ssh-askpass to the location that obsidian-git is looking at.

sudo ln -s $(which ssh-askpass) /usr/X11R6/bin/ssh-askpass

if you don't have a ssh-askpass executable then you might need to install it through brew, I'm not sure if it comes pre-installed. This worked for me on Mac M1 12.4

This did not work for me as X11R6 only exists as a symbolic link itself pointing to a X11 folder that itself is not present.

X11R6 -> ../private/var/select/X11

An ugly workaround would probably be to remove the passphrase from the SSH-key.

nomaad avatar Feb 01 '23 20:02 nomaad

@NaBuchholz Have you installed Obsidian via Flatpak? May you try AppImage?

Vinzent03 avatar Feb 06 '23 21:02 Vinzent03

I have a very similar issue on flatpak installations, but it complains about ksshaskpass (I'm on kde plasma).

Via AppImage I don't have this issue.

bruno-fs avatar Feb 11 '23 16:02 bruno-fs

I have 2 workarounds for dealing with this issue on flatpak:

  1. launch obsidian through console (flatpak run md.obsidian.Obsidian). It will be able to prompt you for the private key. I've no idea why it works, though.
  2. A bit more convoluted but works without opening from cli:
  • first, add/edit your git provider section on ~/.ssh/config:
Host github
   User git
   Hostname github.com
   IdentityFile  <path/to/privatekey>
   IdentitiesOnly yes
   AddKeysToAgent yes
  • once per session, you need to run ssh-add <path/to/privatekey>
  • finally, launch the application from the applications launcher

bruno-fs avatar Feb 11 '23 16:02 bruno-fs

Great it works via AppImage or with workarounds for Flatpak.

Vinzent03 avatar Feb 12 '23 09:02 Vinzent03