-1

I am trying to diagnose a strange network problem with my server: I cannot connect to it using ssh (I get "connection refused"), but, I have some ssh clients that are already open on it from several hours ago, and they work fine.

Also, on the same server there is an http server on port 8000, I can connect to it from the open ssh clients (using lynx http://localhost:8000) but not from my computer.

This is what I get from traceroute:

traceroute to 104.248.40.179 (104.248.40.179), 30 hops max, 60 byte packets
 1  10.0.0.138 (10.0.0.138)  2.025 ms  2.205 ms  2.375 ms
 2  10.17.100.11 (10.17.100.11)  30.228 ms  30.332 ms  30.367 ms
 3  * * *
 4  10.17.110.82 (10.17.110.82)  26.699 ms 10.17.110.66 (10.17.110.66)  27.771 ms 10.17.110.90 (10.17.110.90)  28.701 ms
 5  10.17.111.11 (10.17.111.11)  29.930 ms  31.098 ms  32.761 ms
 6  10.17.111.10 (10.17.111.10)  35.222 ms  18.911 ms  17.638 ms
 7  * * *
 8  10.17.102.1 (10.17.102.1)  22.009 ms 10.17.101.1 (10.17.101.1)  23.693 ms 10.17.102.1 (10.17.102.1)  24.964 ms
 9  BB-191-9.018.net.il (31.210.191.9)  77.354 ms BB-191-17.018.net.il (31.210.191.17)  164.830 ms  164.866 ms
10  te0-0-0-24.rcr22.fra06.atlas.cogentco.com (149.14.208.17)  84.489 ms te0-0-0-34.rcr22.fra06.atlas.cogentco.com (149.14.208.33)  84.592 ms te0-0-0-24.rcr22.fra06.atlas.cogentco.com (149.14.208.17)  85.927 ms
11  be2845.ccr41.fra03.atlas.cogentco.com (154.54.56.189)  69.778 ms  69.342 ms be2846.ccr42.fra03.atlas.cogentco.com (154.54.37.29)  69.338 ms
12  be3187.agr41.fra03.atlas.cogentco.com (130.117.1.117)  70.291 ms be3186.agr41.fra03.atlas.cogentco.com (130.117.0.2)  69.607 ms be3187.agr41.fra03.atlas.cogentco.com (130.117.1.117)  70.673 ms
13  telia.fra03.atlas.cogentco.com (130.117.14.198)  71.609 ms  70.932 ms  80.428 ms
14  digitalocean-ic-328177-ffm-b4.c.telia.net (80.239.128.21)  86.646 ms  85.009 ms  85.417 ms
15  138.197.250.173 (138.197.250.173)  93.542 ms * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

What is the meaning of all these three-star lines up to line 30? And how can I solve the problem?

EDIT: sudo service ssh status on the open ssh clients shows:

● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2019-03-11 19:02:48 UTC; 1h 58min ago
  Process: 9819 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 9826 (sshd)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/ssh.service
           └─9826 /usr/sbin/sshd -D

Mar 11 19:02:48 badkan2 systemd[1]: Starting OpenBSD Secure Shell server...
Mar 11 19:02:48 badkan2 sshd[9826]: Server listening on 0.0.0.0 port 22.
Mar 11 19:02:48 badkan2 sshd[9826]: Server listening on :: port 22.
Mar 11 19:02:48 badkan2 systemd[1]: Started OpenBSD Secure Shell server.
Mar 11 19:10:49 badkan2 sshd[19466]: Did not receive identification string from 104.248.40.179 port 55
Erel Segal-Halevi
  • 33,955
  • 36
  • 114
  • 183
  • 1
    See e.g. https://serverfault.com/q/334029 – jonrsharpe Mar 11 '19 at 20:26
  • 1
    The existence of current ssh connections has no bearing on if new connection will be accepted; once a connection is established, the sshd server can be shutdown, without affecting them. – Don Simon Mar 11 '19 at 20:43
  • @DonSimon how do the existing connections transfer data to/from the server if the sshd is down? – Erel Segal-Halevi Mar 11 '19 at 21:03
  • When a connection is established, the sshd-server forks a child process, which lives on after the parent has died, unless killed directly. – Don Simon Mar 11 '19 at 21:35
  • @DonSimon OK, thanks. In any case, I think the ssh server is still running - I added the output of `sudo service ssh status`. – Erel Segal-Halevi Mar 11 '19 at 21:44

1 Answers1

0

The problem was that, during installation of Apache, for some reason, the firewall was configured to only allow connections for Apache. I solved the problem by listing the firewall apps:

sudo ufw app list

One of the apps was named OpenSSH, so I did:

sudo ufw allow 'OpenSSH'

I still do not understand why the traceroute looks like this. Is this continuous column of three-stars characteristic of a blocking firewall?

Erel Segal-Halevi
  • 33,955
  • 36
  • 114
  • 183