Skip to content

How do I get SSH working on macOS Monterey?

Spread the love


Environment:

  • macOS Monterey MacBook Air M1
  • OpenSSH_8.6p1, LibreSSL 3.3.6
  • iTerm2

I’ve tried a lot of things I found on the internet but I have although very serious problems with my SSH.

I have multiple SSH entries in my SSH-Config file.
My SSH keys are encrypted with rsa and ed25519.

So, every time I change to another project and like to do a git push for example, these Permission denied error message occurs.
This problem I can fix with:

$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/<private_key_file>

If I try to connect to server just.another.service.com of my company with:

$ ssh just.another.service.com

It says:

ssh: connect to host just.another.service.com port 22: Operation timed out

That’s very weird, because my colleagues and me have checked everything twice. On their machines, they use Ubuntu, it works well with the same settings.

ssh -vvv ... says:

OpenSSH_8.6p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/my-user/.ssh/config
debug1: /Users/my-user/.ssh/config line 3: Applying options for *
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: Connecting to ../.. port 22.
ssh: Could not resolve hostname ../..: -65540

So, I’m out of solutions.
Should I reinstall OpenSSH?
Are there default settings in /etc that can be wrong? How look the original files like?
Any ideas?
…any help is very welcome. I try to fix this round about one week now :-/

Leave a Reply

Your email address will not be published. Required fields are marked *