1

SSH stopped working suddenly. I am using macOS 10.13.4. I am getting timeout every time today but all was working yesterday. I have added my public key to GitHub. I get the following output upon running ssh:

$ssh -vvv -T git@github.com 
OpenSSH_7.7p1, OpenSSL 1.0.2o  27 Mar 2018
debug1: Reading configuration data /Users/nurrony/.ssh/config
debug1: /Users/nurrony/.ssh/config line 30: Applying options for github.com
debug1: /Users/nurrony/.ssh/config line 47: Applying options for *
debug1: Reading configuration data /usr/local/etc/ssh/ssh_config
debug2: resolving "github.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to github.com [192.30.255.113] port 22.
debug1: connect to address 192.30.255.113 port 22: Operation timed out
debug1: Connecting to github.com [192.30.255.112] port 22.
debug1: connect to address 192.30.255.112 port 22: Operation timed out
ssh: connect to host github.com port 22: Operation timed out

My ~/.ssh/config reads as follows:

Host github.com
  ControlMaster auto
  ControlPersist 120
  HostName github.com
  User git
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/nur-macbookpro
Host *
  # Always use SSH2.
  Protocol 2

  # Use a shared channel for all sessions to the same host,
  # instead of always opening a new one. This leads to much
  # quicker connection times.
  ControlMaster auto
  Controlpath /tmp/ssh-%r@%h:%p
  ControlPersist 1800

  # also this stuff
  Compression yes
  TCPKeepAlive yes
  ServerAliveInterval 20
  ServerAliveCountMax 10

I have tried every suggestion found by Web search but nothing is working. I can ssh fine when I connect my Mac with mobile hotspot.

How do I resolve this issue?

Update

My issue has been resolved. I figured out that my ISP was blocking port 22. Thanks everyone who has answered. Specially @JohnKeates

  • Does it work when you temporarily remove the ssh user config? Does telnet or netcat work on the ssh port to github? – John Keates Apr 15 '18 at 2:44
  • @JohnKeates Nope it does not work. I removed all user config. netcat or telnet is also timing out. FYI, Firewall is off on my machine – Nur Rony Apr 15 '18 at 3:02
  • 1
    Then it is an external issue, have you tried a different connection? – John Keates Apr 15 '18 at 3:13
  • @JohnKeates Thanks a lot. I can ssh fine when I connect my Mac with mobile hotspot. But I need to do it from my regular connection. Any idea what's going wrong? – Nur Rony Apr 15 '18 at 15:33
  • 1
    This might be hard to debug, it must be anywhere between your connection and github, and if it’s only port 22 then probably inside a firewall somewhere along the way. – John Keates Apr 15 '18 at 15:49
1

Have you tried the following:

  1. Are your identities active? (running: ssh-add -l will tell you).
  2. Since you're keeping your connections alive in the background for Github (not sure why you'd want to do that) once you go idle, the connection may lock you out.
  3. Have you checked your firewall settings to make sure port 22 access is enabled on your end?
  • thanks for your answer. nothing is working 1. I had my id active 2. removed my config 3. firewall is off – Nur Rony Apr 15 '18 at 3:09

You must log in to answer this question.

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