2

Two days ago I logged on server via ssh without any problems. Today I tried to do so 3 times with wrong login (simple mistake), it said there was a login error, so I checked and put in correct login. After that it just stopped and returned Connection timed out. Full output with -vvv argument:

OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 194.29.169.1 [194.29.169.1] port 22.
debug1: connect to address 194.29.169.1 port 22: Connection timed out
ssh: connect to host 194.29.169.1 port 22: Connection timed out

What's more - I tried to go back to this wrong login but now it gave the same result as the correct one.

After hours of searching the solution (firewall etc.) I tried to set up the connection on Windows (Putty) as well as on Windows on different computer but the result was the same. It indicated that it wasn't a platform issue but the connection couldn't be set up because of network. As I thought - after connecting to my mobile hotspot I could set up ssh connection without any troubles. I asked a friend to log on his platform and network and he succeeded as well.

Do you have any idea what could have caused that?

5
  • What exactly indicated "that it wasn't a platform issue but the connection couldn't be set up because of network"? can you successfully ping 194.29.169.1 22? Does telnet 194.29.169.1 22 indicate a listening SSH server? (you can exit the latter using Ctrl-] then Ctrl-D) Jun 17, 2017 at 15:34
  • The fact that I tried this on 2 different computers and 2 operating systems. Yes, I can ping it but telnet returned telnet: Unable to connect to remote host: Connection timed out
    – Fajeczny
    Jun 17, 2017 at 16:01
  • 4
    My best guess is that the remote server has some kind of additional access control such as fail2ban that has (at least temporarily) banned your IP address from connecting Jun 17, 2017 at 16:13
  • Maybe stupid question but your ouput looks exactly the same as in this question .. so are you sure the ssh server is running on the server?
    – derHugo
    Jun 17, 2017 at 20:28
  • @steeldriver you were right, setting up new 3 hours session on server went without any problems :) thank you very much!
    – Fajeczny
    Jun 18, 2017 at 9:41

1 Answer 1

1

@steeldriver hit the nail on the head: this is a (or similar) tool blocking (temporarily) your IP address.

It may be worth whitelisting your IP (though, if you're on a non-static connection method (eg from a home cable modem), this won't be effective; or if your machine is compromised, it could auto-login to remote devices and run nefarious content thereon):

Whitelisting is setup in the jail.conf file using a space separated list.

[DEFAULT]
# "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not                          
# ban a host which matches an address in this list. Several addresses can be                             
# defined using space separator.

or

ignoreip = 127.0.0.1 192.168.1.0/24 8.8.8.8 
# This will ignore connection coming from common private networks.
# Note that local connections can come from other than just 127.0.0.1, so
# this needs CIDR range too.
ignoreip = 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16

You might also consider increasing the number of bad tries and/or cutting the length of the ban - see the fail2ban jail options documentation.

You must log in to answer this question.

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