Could not connect to the Git repository by SSH protocol
I'm trying out TeamCity, but I'm already stuck at Repository setup. Using a url of the form:
git@git.ca.somecompany.com:od/CRInstaller.git
I get the following error:
Could not connect to the Git repository by SSH protocol. Tried 1 SSH key accessible from the current project. Error message: git -c credential.helper= ls-remote origin command failed. exit code: 128 stderr: Unable to negotiate with 150.247.78.157 port 22: no matching host key type found. Their offer: ssh-rsa fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
I've tried generating a new key from this reference:
https://www.jetbrains.com/help/teamcity/git.html#Authentication+Settings
ssh-keygen -t rsa -m PEM
but it didn't help.
Any help appreciated.
Thanks.
Please sign in to leave a comment.
Figured it out. Had to add the following to "C:\Program Files\Git\etc\ssh\ssh_config" (Windows):
Host 150.247.78.157
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
Host git.ca.somecompany.com
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
I tried the first one and it didn't work, then added the second. Not sure if both are actually needed, but it works now.