Назад | Перейти на главную страницу

Тайм-аут случайного подключения SSH

У меня странная проблема при попытке подключиться к серверу через SSH. Более чем в 80% случаев я получаю тайм-аут соединения, но иногда мне удается подключиться.

Я за маршрутизатором, поэтому у всех в офисе один и тот же внешний IP-адрес, но почему-то я получаю много таймаутов подключения, но у одного из коллег, который работает под управлением Windows + Putty, проблем нет.

Пример:

user@user-HP-Pavilion-Gaming-Notebook ~ $ date; ssh -vvv root@srv.domain.com

Wed Mar 15 12:58:53 CET 2017
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "srv.domain.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to srv.domain.com [122.55.66.77] port 22.
debug1: connect to address 122.55.66.77 port 22: Connection timed out
ssh: connect to host srv.domain.com port 22: Connection timed out





user@user-HP-Pavilion-Gaming-Notebook ~ $ date; ssh -vvv root@srv.domain.com

Wed Mar 15 12:58:59 CET 2017
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "srv.domain.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to srv.domain.com [122.55.66.77] port 22.
debug1: connect to address 122.55.66.77 port 22: Connection timed out
ssh: connect to host srv.domain.com port 22: Connection timed out



user@user-HP-Pavilion-Gaming-Notebook ~ $ date; ssh -vvv root@srv.domain.com

Wed Mar 15 12:59:03 CET 2017
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "srv.domain.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to srv.domain.com [122.55.66.77] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Debian-5+deb8u3
debug1: match: OpenSSH_6.7p1 Debian-5+deb8u3 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to srv.domain.com:22 as 'root'
debug3: hostkeys_foreach: reading file "/home/user/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/user/.ssh/known_hosts:12
debug3: load_hostkeys: loaded 1 keys from srv.domain.com
debug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent

Я также попытался проверить, есть ли какая-то информация о проблеме в /var/log/auth.log, но я ничего не вижу, когда пытаюсь подключиться и получаю тайм-аут.

Сервер хорошо реагирует на пинг, но я также пытался подключиться через telnet к порту 22, и тот же таймаут.

Любые идеи?

Я использую Linux Mint, а сервер находится под Debian Jessie.

Может быть проблема с DNS. Попробуйте отключить разрешение dns на ssh сервере.

# /etc/ssh/sshd_config
UseDNS no