1

I used to connect normally to the website on digitalocean using ssh keys and it works normally. Currently I tried to connect and suddenly I keep getting: ssh_exchange_identification: read: Operation timed out.

I tried to run the ssh command again using -vvv and I got the following:

OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: /etc/ssh/ssh_config line 102: Applying options for *
debug1: Connecting to ip [ip] port 22.
debug1: Connection established.
debug1: identity file /Users/safwany/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/safwany/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/safwany/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/safwany/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/safwany/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/safwany/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/safwany/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/safwany/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
ssh_exchange_identification: read: Operation timed out

Any idea what is the cause for such error and how to fix it?

Update: I ran ls -al ~/.ssh and got the following:

total 160
drwx------   15 safwany  staff    510 Jul 12 23:52 .
drwx------+ 109 safwany  staff   3706 Jul 13 00:02 ..
-rwx------    1 safwany  staff   2437 Jul 13 00:02 authorized_keys
-rw-------    1 safwany  staff   1679 Mar 17  2015 digitalocean
-rw-r--r--    1 safwany  staff    413 Mar 17  2015 digitalocean.pub
-rw-------    1 safwany  staff   1679 Mar  4  2015 fortrabbit
-rw-r--r--    1 safwany  staff    413 Mar  4  2015 fortrabbit.pub
-rwx------    1 safwany  staff   1766 Nov 21  2014 github_rsa
-rwx------    1 safwany  staff    404 Nov 21  2014 github_rsa.pub
-rw-------    1 safwany  staff   1675 Jul  1  2015 id_boot2docker
-rw-r--r--    1 safwany  staff    413 Jul  1  2015 id_boot2docker.pub
-rw-------    1 safwany  staff   1675 Nov 23  2014 id_rsa
-rw-------    1 safwany  staff    381 Jul 12 23:16 id_rsa.pub
-rw-------    1 safwany  staff  17736 Jul 10 17:11 known_hosts
-rw-------    1 safwany  staff  15268 Feb 21 22:44 known_hosts.old
  • This might be a file permissions issue: see http://unix.stackexchange.com/questions/235565/cant-login-to-a-remote-machine-with-key – John1024 Jul 12 '16 at 21:38
  • @John1024 Could you elaborate more? I can't find a clear answer – omarsafwany Jul 12 '16 at 21:49
  • ssh is very picky about file permissions. Can you run ls -al ~/.ssh and show us the results. – John1024 Jul 12 '16 at 21:52
  • @John1024 Check the update – omarsafwany Jul 12 '16 at 22:04
  • Those permissions and the file list look good to me. My next thought is to check on the cause of the message ssh_exchange_identification: read: Operation timed out. Do you have access to the server's logs to see if its ssh is up and running and saw your connection attempt? – John1024 Jul 12 '16 at 22:13
  • 1
    The most common location for sshd logs is /var/log/secure, you can grep it for your own public IP (connecting party) to find the relevant pieces. – grochmal Jul 12 '16 at 23:21
  • Operation timed out -- not a permission issue. Firewall or network problem. Can you ping the server? Can you connect to other ports? Do you have enough free space on the drive? – Jakuje Jul 13 '16 at 07:23

0 Answers0