Skip to content

Instantly share code, notes, and snippets.

@Gnosnay
Last active May 19, 2024 08:23
Show Gist options
  • Select an option

  • Save Gnosnay/1bb26acf58dea6b3f8d50e767b39d577 to your computer and use it in GitHub Desktop.

Select an option

Save Gnosnay/1bb26acf58dea6b3f8d50e767b39d577 to your computer and use it in GitHub Desktop.
SSH doesn't work when upgrade MacOS to Ventura 13.0.1

SSH doesn't work when upgrade MacOS to Ventura 13.0.1

Problems

After you upgrade your MacOS to Ventura 13.0.1 you may meet following problem:

16:14:32 › ssh -vvvvvv 10.123.1.1
OpenSSH_9.0p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/my-user/.ssh/config
debug1: /Users/my-user/.ssh/config line 19: Applying options for 10.123.1.1
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/my-user/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/my-user/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: identity file /Users/my-user/.ssh/rsa.private type -1
debug1: identity file /Users/my-user/.ssh/rsa.private-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.0
my-user@your-server: Permission denied (publickey).
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535

problem can be found kex_exchange_identification: Connection closed by remote host

Cause

New version MacOS deprecate some algorithm during the handshake with server. So to be compatible with outdated server side, we need to add some config on our local like this way:

# edit ~/.ssh/config
# add following stuff
Host *
    SendEnv LANG LC_*
    # compatible with ssh-rsa
    # cuz some server didn't support it
    PubkeyAcceptedAlgorithms +ssh-rsa
    HostkeyAlgorithms +ssh-rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment