1

I get the following error trying to push / pull to our local Git Serrver / BitBucket installation after upgrading VS to 2022 17.2.4

Unable to negotiate with 192.168.16.140 port 7999: no matching host key type found. Their offer: ssh-rsa

I followed the instructions in the post below but still no joy, what am I doing worng here!...

Have tried adding this to the ssh_config file

Host git@devtools:7999 HostkeyAlgorithms +ssh-rsa PubkeyAcceptedAlgorithms +ssh-rsa

Host 192.168.16.140:7999 HostkeyAlgorithms +ssh-rsa PubkeyAcceptedAlgorithms +ssh-rsa

Visual Studio 2022 git error Unable to negotiate with {0} port {1}: no matching host key type found. Their offer: ssh-rsa

  • Note that the *best* solution to this problem is to upgrade your server. You may not have the administrative ability to do that, of course, but you can point out to your administrator (whoever that is) that ssh-rsa has been deprecated because it's no longer secure. – torek Jun 30 '22 at 10:15
  • Hi, any update about this issue? Does the answer can solve the issue? – Jingmiao Xu-MSFT Jul 01 '22 at 08:31

1 Answers1

5

Brew update of openssl brings in the latest version which has deprecated the ssh-rsa algorithm. Note

Add this to your ssh config to re-enable ssh-rsa OR downgrade openssl to the previous version.

Host *
   HostkeyAlgorithms +ssh-rsa
   PubkeyAcceptedAlgorithms +ssh-rsa

ssh config file will be ~/.ssh/config or /etc/ssh/ssh_config.

halfer
  • 19,824
  • 17
  • 99
  • 186
Aamir M Meman
  • 1,645
  • 14
  • 15
  • Added the lines as you suggest to the end of my ProgramFiles\Microsoft\VisualStudio\Prfessional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\TeamExplorer\Git\etc\ssh\ssh_config file But still the same, does this line need to go in a different folder? When you say ~/.ssh/config - where is that exactly? When you say downgrade openssl to previous version - how to do that? – WebInspired Jun 30 '22 at 06:41