For remote connection to the server, I use ssh user@host , and I don’t have to do it once.

Sometimes it connects normally, sometimes crashes.

port 22: Connection timed out

The standard port did not change. In general, I did not change anything, all settings are default.

The same story with mounting sshfs , through time.

Even the bowl does not connect.

Where to look for the cause? Well, I couldn’t connect at all, but sometimes everything is fine.

In LAN, everything works like a clock.

  • Is connecting to other ports normal? - aleksandr barakin
  • In general, this is normal (more or less). Check the network, you can also on the host to which you connect change the timeout time in the sshd.conf config. - andy.37
  • 80 Apache, works without failures. Taymut change nevidu until sense, either immediately connects or hangs before the timeout. - user199588

1 answer 1

if connections to other ports are normal, then network failures along the packet path and temporary server overload can be eliminated.


perhaps, somewhere along the packet path, filters are triggered, limiting the number of new connections per unit time to a given port.


I proceed further from the assumption that any of the distributions of the gnu / linux operating system are installed on the server.

To determine whether this is happening on your server, or even before it, it is worth making sure that connection attempts are recorded in logs ( /var/log/auth.log , /var/log/audit/audit.log , etc.) in those moments when you get an error about the expiration of the connection time.

It is also worth inspecting the netfilter rules on your server for limiting rules :

 $ sudo iptables-save | grep limit 

update about another port :

and, of course, it makes sense to try connecting to another port: add the port номер_порта (in addition to the existing port 22 ) on the server in /etc/ssh/sshd_config and connect using this port ( sshd will need to be restarted):

 $ ssh -p номер_порта пользователь@машина 

номер_порта makes sense to choose from the range “greater than 1024” (maximum number - 2 16 = 65536).

and in order not to specify the port each time, add a couple of lines to ~/.ssh/config :

 host машина port номер_порта 
  • On the Ubuntu Server 14.04.3 LTS server, as soon as I can break through the timeout, I will definitely check - user199588
  • The same problem with the firewall turned off altogether, nothing is registered in /var/log/auth.log if the connection fails ... var/log/audit/audit.log there is no such thing at all - user199588
  • it means, most likely, blocking happens somewhere between you and the server. try using a different port (I added the answer). - aleksandr barakin