Apple - Git hangs with a ssh remote URI after 10.15.4 update

Debugging steps:

  1. Attempted to connect with netcat:
$ nc -v gitlab.example.com 30814
Connection to gitlab.example.com port 30814 [tcp/*] succeeded!
SSH-2.0-OpenSSH_7.2
^C
  1. Suspecting a broken ssh client, I installed openssh using brew:
$ brew install openssh
...
$ /usr/local/bin/ssh  -V
OpenSSH_8.2p1, OpenSSL 1.1.1d  10 Sep 2019

$ /usr/local/bin/ssh -p 30814 [email protected]
Welcome to GitLab, @username!
Connection to gitlab.example.com closed.

After refreshing my shell environment to ensure that the new ssh is found in my $PATH, git operations began functioning as expected with ssh:// URIs.

Searching turned up this user submitted bug: ssh fails when using -p flag

The workaround detailed in the bug is to use the remote host's IP address instead of the DNS name. I can confirm that this worked for me:

$ /usr/bin/ssh -V
OpenSSH_8.1p1, LibreSSL 2.7.3

$ /usr/bin/ssh -p 30814 [email protected]
Welcome to GitLab, @username!
Connection to gitlab.example.com closed.

The apparent trigger for this bug is using ports greater than 8192 in conjunction with a host's DNS name.

Tags:

Git

Ssh

Catalina