GitHub: The unauthenticated git protocol on port 9418 is no longer supported

GitHub recently improved security, so you may get the error below like I did when I tried to install oh-my-zsh on a new Mac.


Anton.Perez@amp ~ % sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Cloning Oh My Zsh...
fatal: remote error: 
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
/Users/Anton.Perez
Error: git clone of oh-my-zsh repo failed

You can test if it’s because you need to add an SSH key by running:


ssh -vvv git@github.com

You’ll get an error like so if so:


...
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).

If so, just generate a new key and add it to your GitHub account (see this. That’s it!

IntelliJ IDEA: Getting “Fetch failed. Fatal: Could not read from remote repository”

In case you encounter this issue, do the following:

1. Preferences > SSH
2. Make sure SSH executable is set to “Native.” (If already so, switch to “Built-in,” apply it, then switch back to “Native.”)
3. Happy fetching!