Skip to content

[Bug]: MacOS - Permission denied (publickey) when using obsidian-git, but at the command line, git works. #959

@ek778

Description

@ek778

Describe the bug

Installed versions:
MacOS 15.6.1
Obsidian 1.9.12
Obsidian-git 2.35.0
git 2.39.5

  • ssh key configured in remote server

I get a permission denied (publickey) error when trying to execute a Git: Push from the command palette. The error is below from the debug console. It implies that there is a problem with my key configuration. However, from the vault directory, I can interact with git just fine:
ehodge@ehodge-mac obsidian-work % git push
Enter passphrase for key '/Users/ehodge/.ssh/id_ed25519':
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 10 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 436 bytes | 436.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To ssh://192.168.7.93:2200/eric/obsidian-work.git
91ef2f9..2b5a02e main -> main

I've tried deleting and re-cloning the repo, uninstalling and re-installing the plugin. Same error every time.

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

obsidian-git: Error: Pushing to ssh://192.168.7.93:2200/eric/obsidian-work.git
[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.

    at Object.action (plugin:obsidian-git:107:11263)
    at fB.exec (plugin:obsidian-git:107:11759)
    at eval (plugin:obsidian-git:106:6943)
    at new Promise (<anonymous>)
    at Ig.handleTaskData (plugin:obsidian-git:106:6832)
    at Ig.attemptRemoteTask (plugin:obsidian-git:106:6488)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Ig.attemptTask (plugin:obsidian-git:106:5970)

Steps to reproduce

Cloned vault from repo to local machine.
Opened obsidian, installed obsidian-git
Restarted Obsidian
Opened cloned vault
Attempt Git: Push from command palette
Yields error.

Expected Behavior

Git: Push from command palette should succeed if user is able to do so from the command line.

Addition context

No response

Operating system

macOS

Installation Method

None

Plugin version

2.35.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions