While trying to clone a Git repository on a Ventura virtual machine using SSH, you encounter errors like "Host key verification failed
" or "no matching host key type found
".
Most frequently, these errors happen due to compatibility issues with the Ventura OS's SSH configuration. As a result, SSH connections to remote hosts that only support SHA1 may fail.
You can resolve this issue by modifying the SSH configuration on your Ventura machine.
To do so, add the following Script Step just before the failing Step:
#!/usr/bin/env bash cd /Users/vagrant/git ls -ltr ls -a cat .git/config echo ssh cd /Users/vagrant/ ls -a cd .ssh ls -a cat config echo before a=' ' echo "Host *" >> config echo "UseKeychain yes" >> config # Don't forget to edit host name with your own echo "Host {Host name}" >> config echo "${a}User git" >> config echo "${a}PubkeyAcceptedAlgorithms +ssh-rsa" >> config echo "${a}HostkeyAlgorithms +ssh-rsa" >> config
This Script Step navigates to the Ventura machine's .ssh
directory, opens the config file, and adds the required lines to enable the ssh-rsa algorithm for host key and public key authentication.