Gentoo не заходит по SSH – Read from socket failed: Connection reset by peer

Сегодня получил “отлуп” при попытке зайти по SSH на один из своих серверов:

$ ssh server777.domain.ru
Read from socket failed: Connection reset by peer

Отчего именно, непонятно. Через Putty зайти также могу. Телнет показывает, что порт открыт. У меня также получалось зайти с самого моего шлюза (т.е. IP-адрес не фильтруется), и из дома, и с другого сервера – но зайти на этот злополучный server777 со своей Gentoo у меня так и не получилось.

$ ssh -v server777.domain.ru
OpenSSH_5.8p2-hpn13v11lpk, OpenSSL 1.0.0d 8 Feb 2011
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to server777.domain.ru [123.456.123.456] port 22.
debug1: Connection established.
debug1: identity file /home/tam/.ssh/id_rsa type -1
debug1: identity file /home/tam/.ssh/id_rsa-cert type -1
debug1: identity file /home/tam/.ssh/id_dsa type -1
debug1: identity file /home/tam/.ssh/id_dsa-cert type -1
debug1: identity file /home/tam/.ssh/id_ecdsa type -1
debug1: identity file /home/tam/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 FreeBSD-20080901
debug1: match: OpenSSH_5.1p1 FreeBSD-20080901 pat OpenSSH*
debug1: Remote is NON-HPN aware
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8p2-hpn13v11lpk
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: AUTH STATE IS 0
debug1: REQUESTED ENC.NAME is 'aes128-ctr'
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: REQUESTED ENC.NAME is 'aes128-ctr'
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
Read from socket failed: Connection reset by peer

Решение оказалось простым, нужно ограничить список используемых методов шифрования:

$ ssh -c aes128-ctr server777.domain.ru

Чтобы исключение работало постоянно и без ввода лишних ключей, нужно дописать в файле /etc/ssh/ssh_config следующие строчки:

Host server777.domain.ru
    Ciphers aes128-ctr

Похожие статьи

Leave a Reply

Your email address will not be published. Required fields are marked *