5

So, I'm having this issue with git & Github where things work as expected when I use the terminal however tying to do anything from Git GUI Clients like the GitHub desktop app, SourceTree, Fork gives me the Permission denied (publickey) issue.

Even trying out commands like ssh -T git@github.com in the terminal, works as expected. Here's a screenshot of my Github Account settings from Fork: As you can see, it looks like even my SSH key has been configured correctly & seems to be recognized. I want to avoid the process of generating a new SSH key and setting it up in GitHub unless there's literally no other option.

enter image description here

David West
  • 552
  • 2
  • 9
  • 21

1 Answers1

2

Even trying out commands like ssh -T git@github.com in the terminal, works as expected.

Double-check the SSH URL used for your remote repository in those GUI clients.

It should be git@github.com:<me>/<myrepo>.

As, as I mentioned here, try first, before launching GitHub Desktop:

git config --global core.sshCommand "'C:\Windows\System32\OpenSSH\ssh.exe'"

(assuming Windows 10 here)

For Mac, follow "How to Manage Multiple SSH Keys" and make sure your key is added to the ssh-agent:

ssh-add -K ~/.ssh/_id_rsa

with a ~/.ssh/config

Host *
  AddKeysToAgent yes
  UseKeychain yes

SSH will look for key in keychain and if it finds it you will not be prompted for password.
Key will also be added to ssh-agent. On MacOS this will work on MacOS Sierra 10.12.2 or later.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250