skip to Main Content

I have a working setup with Visual Studio 2022 17.3.6 on a Windows laptop and Mac M1 running macOS 12.6.1. When I run an Uno project or a Xamarin project it connects as expected to the Mac. I just upgraded the Mac to Ventura and am no longer able to connect. I understand the only thing that has changed is moving to Ventura, but am stuck on how to proceed.

The exact error is:

An error occurred while trying to establish an SSH connection with SSH keys to ‘ip:22’

I have tried the following:

  • SSH from my laptop in Ubuntu for Windows- worked
  • SSH from another computer- worked
  • Verified Remote Login settings on Mac
  • Ran ssh username@macip ‘ls’ and it worked
  • Deleted %LOCALAPPDATA%XamarinMonotouch – no change
  • Reviewed Visual Studio log- no additional information
  • Reviewed log on Mac and no additional information

5

Answers


  1. One reason could be the fact that Ventura comes with OpenSSH_9.0p1. Starting with OpenSSH v8.8, RSA signatures using SHA-1 are disabled:

    This release disables RSA signatures using the SHA-1 hash algorithm by default”.

    Fix SSH(RSA SHA-1) not working in macOS Ventura

    1. edit /etc/ssh/sshd_config and save it:

      HostkeyAlgorithms +ssh-rsa
      PubkeyAcceptedAlgorithms +ssh-rsa
      
    2. reboot sshd

    macOS Monterey and older versions used OpenSSH v8.6 or older, respectively.

    Login or Signup to reply.
  2. I’ve tried @monogano answer and it dit not work for me.

    I’ve added the same lines :

    HostkeyAlgorithms +ssh-rsa
    PubkeyAcceptedAlgorithms +ssh-rsa
    

    at the end of the /etc/ssh/ssh_config file (without restarting anything) and now my ssh connections are working again.

    EDIT :

    To keep the configuration between updates and so on, one must create a new file in /etc/ssh/ssh_config.d with the same lines as all files from this directory are included in /etc/ssh/ssh_config

    Login or Signup to reply.
  3. This concerns all OS Ventura system (eg. Terminal and Iterm) and not only VS. After ssh -vvv [my_concerned_host] I could see at the end of the report send_pubkey_test: no mutual signature algorithm. Then. SSH switch automatically to the next authentication method: password

    For me applying @TylerH workaround in root ssh config was not enough. I also had to do it in my (profile) config : ~/.ssh/config + source ~/.bash_profile for applying changes. As they (already) said in 03/21 [Here] (https://confluence.atlassian.com/bitbucketserverkb/ssh-rsa-key-rejected-with-message-no-mutual-signature-algorithm-1026057701.html), RSA now offers too much vulnerabilities. **The patch in sshd_config should only be applied by people who can’t regenerate Keys pair with a stronger algorithm ** (eg. ECDSA or ED25519)

    If you have multiple hosts the 2 added lines must be preceded bye : Host *

    Host *
      HostkeyAlgorithms +ssh-rsa
      PubkeyAcceptedAlgorithms +ssh-rsa
    
    Login or Signup to reply.
  4. I’d argue that a more appropriate fix would be to install a newer version of OpenSSH for Windows rather than re-enabling defunct RSA SHA-1 signatures on the Mac side. Granted, v9.1.0.0p1 was not available until December 2022 after other answers were posted:

    1. On the Windows machine, open "Optional features"
    2. Search for the "OpenSSH Client" and expand it
    3. Click the "Uninstall" button
    4. Download and install OpenSSH for Windows v9.1.0.0p1 or greater

    I have found that Visual Studio will implicitly use the new version and you’ll be able to connect to the Mac again.

    Login or Signup to reply.
  5. The issue is caused because Ventura comes with OpenSSH_9.0p1 which disables RSA signatures with SHA-1 by default. That means that ssh-ing to any server using RSA signatures with SHA-1 will not work (affecting many old servers). I’ve finally managed to fix it. This solution works immediately without need to restart ssh, and is persistent even after you update macOS. To fix the problem:

    Step 1: Go to /etc/ssh/ssh_config.d

    sudo cd /etc/ssh/ssh_config.d
    

    Step 2: Create a new file called config:

    sudo nano config
    

    Step 3: Add the following and save the file (Ctrl-O then Ctrl-X)

    HostkeyAlgorithms +ssh-rsa
    PubkeyAcceptedAlgorithms +ssh-rsa
    

    You should be able to connect via SSH now.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search