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 65535problem can be found kex_exchange_identification: Connection closed by remote host
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