1

I'm on a Windows 10 machine and I have both Git Bash and Ubuntu for Windows Subsystem for Linux (WSL) installed. When I use GitHub's official desktop app to clone a repo via HTTPS everything works fine and I can push my commits via Visual Studio Code with no problems whatsoever. I then try to clone a repo via SSH with Hyper (WSL Bash) and get this:

The authenticity of host 'domain.com (a.b.c.d)' can't be established.
RSA key fingerprint is XX:XX:...:XX.
Are you sure you want to continue connecting (yes/no)?

After answering yes and openning that repo in VS Code and try to push my new changes to GitHub, I get this error: Git: Host key verification failed.

And this is what I get as Git Log in Output: Host key verification failed. fatal: Could not read from remote repository.

I have set up my SSH key on WSL using this method and I didn't set up any passphrase. I tried this on my brother's PC which is exactly set up like mine and it worked just fine. I would appreciate any help!

UPDATE: I typed ssh -T git@github.com in Hyper and got this as an answer: You've successfully authenticated, but GitHub does not provide shell access.

P.S. I'm a newbie in programming and stackoverflow, so please be concise and give me step by step instructions. The more you use technical terms, the more I'll probably get lost!

SepSol
  • 115
  • 3
  • 10
  • Does this answer your question? [Git error: "Host Key Verification Failed" when connecting to remote repository](https://stackoverflow.com/questions/13363553/git-error-host-key-verification-failed-when-connecting-to-remote-repository) – phd Mar 09 '20 at 13:38
  • https://stackoverflow.com/search?q=%5Bssh%5D+Host+key+verification+failed – phd Mar 09 '20 at 13:38

2 Answers2

0

Try first, for that new push, to do it in command line:

cd c:\path\to\local\repo
git status
git log
git remote -v
git push -u origin master

Make sure that:

  • git status is clean (no pending changes)
  • git log shows you at least one commit
  • git remote -v shows you as origin the URL of your remote GitHub repository
    (as an SSH URL git@github.com:<you>/<yourRepo>)

Then push, and go back to VSCode.

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

Should be faster than the other solution:

  1. In vscode open a new terminal of type "Command Prompt"
  2. Run: git push and accept the new key when prompted.

This will store the remote key for future use.

Dev Null
  • 716
  • 1
  • 8
  • 20