tschaub/gh-pages

SSH Authentication Not Working

jack-farley opened this issue · 3 comments

Hi,
I've been trying to deploy my app using gh-pages with the command line command 'gh-pages -d build'. However, I've been getting the following error:

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Usually this indicates that an ssh key is either not set up, is set up incorrectly, or is no longer valid. However, I am able to pull and push normally from this repository using ssh key - for some reason it only doesn't work when using gh-pages.

Is this package meant to be set up for ssh key authentication? And if this is a problem on my end, do you have any idea what it might be?

Had to add my sshCommand to the global github configuration, works now.

I'm having this same issue as well. Pulling/pushing works fine, and ssh keys are set up correctly and are valid.
Though I'm not well-versed in how ssh works. So I'm wondering, what ssh command you are using in the git global config?

I have configured sshCommand to be:
ssh -i ~/.ssh/id_ed25519

Still getting the same error message though.

For me this happened because ssh-agent was not working in the shell I was working in. Normally, git asks for a password. Because git is now executed non-interactively, this doesn't happen and the command failed. Solved it by opening a new shell with ssh-agent properly loaded.