Troubleshooting: Build Fails Due to SSH Handshake

Problem

As of March 15, 2022, GitHub no longer supports the DSA SHA256 key type. Custom images with git installed before November 16, 2021, may fail during checkout with this error:

Either git or ssh (required by git to clone through SSH) is not installed in the image
Cloning git repository

error cloning repository: ssh: handshake failed: knownhosts: key mismatch

Solution

Update git on your custom image and use one of GitHub's recommended SSH key types.

To update your SSH key type:

  1. Generate a new SSH key using an algorithm that GitHub supports (RSA with SHA-2, Ed25519, ECDSA, or Ed25519-sk)
  2. Add the new key to your GitHub account

 

Additional Resources

Was this article helpful?
0 out of 2 found this helpful

Comments

0 comments

Article is closed for comments.