I am experiencing a timeout connection error when using ssh from my MacBook to connect to an external server. The problem started immediately after having updated to macOS 10.15.6. I could connect smoothly before that. The server is working correctly, I can connect from other machines.

$ ssh -v T800                   
OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/XYZ/.ssh/config
debug1: /Users/XYZ/.ssh/config line 22: Applying options for T800
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.
debug1: connect to address xxx.xxx.xxx.xxx port 22: Operation timed out
ssh: connect to host xxx.xxx.xxx.xxx port 22: Operation timed out

/etc/ssh/ssh_config contains a bunch of commented lines and then:

Host *
        SendEnv LANG LC_*

While /Users/XYZ/.ssh/config for T800 is:

Host T800
        Hostname xxx.xxx.xxx.xxx
        User john
        Port 22
        UserKnownHostsFile ~/.ssh/know_hosts

The firewall of my MacBook is turned off, and the one on the server is correctly configured. I can ping the server from my MacBook and I can access it via ssh from other machines, including my second MacBook wich is still running an older version of macOS.

A similar (yet different) problem is described here, I tried the solution proposed but it didn't work in my case.

Any clue?

  • 1
    Have a look at the last two lines where is says “Operation timed out.”. This means that your SSH client tried to establish the connection, however it sat waiting for the server to respond. It gave up when it didn’t get a response. Typically a firewall will cause a rejection, but check your and the server for firewall(s) between you two. Also make sure that the server is up and running and accepting connections. – Allan Aug 26 '20 at 22:07
  • The firewall on my Mac is turned off. The server is well configured, it was working before the update and it is working from other machines, I can ssh in the server from other computers. Pinging the server IP works as well. – alec_djinn Aug 27 '20 at 6:51
  • Try increasing verbosity (-vvv). Also - try to compare any relevant ssh config files (user and system ones) from the working mac - are there any differences? (I guess that the system upgrade has overwritten something?) – Iľja Aug 27 '20 at 8:56
  • I have tried the resetting NVRAM, but it only works the first time. After that it always indicates timeout Any other suggestion will be greatly appreciated. – Shaoqun Zhou Oct 30 '20 at 15:52
  • @ShaoqunZhou I don't know how to help. It worked for me and I don't have problems with it anymore. – alec_djinn Oct 31 '20 at 12:56

Somehow resetting NVRAM solved the issue. I am still puzzled about the cause of the bug, but at least I got ssh working properly again.

Here is a link to an Apple help-document on how to do this: https://support.apple.com/en-us/HT204063

  • 3
    There is nothing in NVRAM that has anything to do with networking. You can see the contents with nvram -xp. More than likely is was the reboot that naturally happens when you do an NVRAM reset. – Allan Oct 19 '20 at 19:50
  • I try reboot before applying above suggestion. Restart didn't help. Maybe full stop and start was a fix? – Wawrzek Oct 20 '20 at 15:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .