Ssh exchange identification connection closed by remote host astra linux

Содержание
  1. ssh_exchange_identification: Connection closed by remote host
  2. ssh_exchange_identification: соединение закрыто удаленным хостом (без использования hosts.deny)
  3. Поиск неисправностей sshd
  4. Ssh exchange identification connection closed by remote host astra linux
  5. Symptoms
  6. Solutions
  7. Check /etc/hosts.deny and /etc/hosts.allow
  8. Missing Dependencies
  9. Corrupted Fingerprint / Keys
  10. Heavy Server Load
  11. SSH exchange identification: соединение закрыто удаленным хостом под Git bash
  12. 14 ответов
  13. Ssh exchange identification connection closed by remote host astra linux
  14. Re: SSH Problem: ssh_exchange_identification
  15. Re: SSH Problem: ssh_exchange_identification
  16. Re: SSH Problem: ssh_exchange_identification
  17. Re: SSH Problem: ssh_exchange_identification
  18. Re: SSH Problem: ssh_exchange_identification
  19. Re: SSH Problem: ssh_exchange_identification
  20. Re: SSH Problem: ssh_exchange_identification
  21. Re: SSH Problem: ssh_exchange_identification
  22. Re: SSH Problem: ssh_exchange_identification
  23. Re: SSH Problem: ssh_exchange_identification
  24. Re: SSH Problem: ssh_exchange_identification
  25. Re: SSH Problem: ssh_exchange_identification
  26. Re: SSH Problem: ssh_exchange_identification
  27. Re: SSH Problem: ssh_exchange_identification
  28. Re: SSH Problem: ssh_exchange_identification
  29. Re: SSH Problem: ssh_exchange_identification
  30. Re: SSH Problem: ssh_exchange_identification
  31. Re: SSH Problem: ssh_exchange_identification
  32. Re: SSH Problem: ssh_exchange_identification

ssh_exchange_identification: Connection closed by remote host

Всем добрый день.

При соединении с сервером мне начала периодически выскакивать ошибка

Много гуглил, настроил /etc/hosts.allow

/etc/hosts.deny чист как слеза младенца.

Так как к серверу по ssh может быть подключено до 1к клиентов, настроил в /etc/ssh/sshd_config

Ошибка все равно проявляется. Кто-нибудь подскажет из-за чего такое может быть? Самое интересное, что такая ошибка стала проявляеться сразу на 2х серверах.

На одном из двух заболевших серверов fail2ban даже не установлен.

Какие? Покажу все, какие нужно.

Запусти с -v и посмотри в чём проблема.

ОК. Запустил. Что из этого понятно?

алсо, запусти дебаг на сервере.

Дебагом на сервере не получается отловить ситауацию с ошибкой — на сервер пробрасывают по 3 порта несколько десятков клиентов при помощи autossh. К тому моменту, как я делаю попытку подключения, sshd уже подключен к другому клиенту.

MaxAuthTries не настраивал. Видимо, он установлен по-умолчанию.

Где-то на одном за англоязычных форумов мельком увидел, что причиной может быть какая-то фигня с knowт_hosts, но полного объяснения небыло. Как посмотреть в это сторону?

Оба сервера говорят ерунду:

что по-твоему должна сделать эта команда? ты ман вообще читал?

MaxAuthTries не настраивал. Видимо, он установлен по-умолчанию.

ты можешь просто показать свой конфиг или мне надо продолжать угадывать что там у тебя?

К тому моменту, как я делаю попытку подключения, sshd уже подключен к другому клиенту.

чтоа? о чем это вообще? в лююбом случае, просто запусти вторую копию на отдельном порте, тогда ты там точно будешь единственный клиент.

Источник

ssh_exchange_identification: соединение закрыто удаленным хостом (без использования hosts.deny)

Я не использую hosts.allow или hosts.deny , более того, SSH работает с моей Windows-машины (тот же ноутбук, другой жесткий диск), но не с моей Linux-машины.

ssh -vvv root@host -p port дает:

На машине с Windows все работает нормально, поэтому я проверил журналы безопасности, и строки в них идентичны, сервер обрабатывает две разные «машины» одинаково, и они оба разрешены через аутентификацию с открытым ключом.

Так что это приводит к выводу, что это должно быть проблемой с моим локальным ноутбуком ArchLinux . но что?

Так что это не проблема ..

Нет конфликтов с настройками брандмауэра (пока).

Разрешения, кажется, в порядке (то же самое на сервере). Также пытались без настройки /etc/ssh/ssh_config с тем же результатом, за исключением большого количества автоматической конфигурации, выполняемой на клиенте, которая заканчивается той же ошибкой.

Если вы исключили какие-либо «внешние» факторы, следующий набор шагов обычно помогает сузить их. Таким образом, хотя это не дает прямого ответа на ваш вопрос, оно может помочь отследить причину ошибки.

Поиск неисправностей sshd

Что я нахожу в целом очень полезным в любых таких случаях, так это начать, sshd не позволяя этому демонизироваться. Проблема в моем случае заключалась в том, что ни то, ни другое syslog не auth.log показало ничего значимого.

Когда я запустил его из терминала, я получил:

Намного лучше! Это сообщение об ошибке позволило мне увидеть, что не так, и исправить это. Ни один из файлов журнала не содержал этот вывод.

NB: по крайней мере в Ubuntu $(which sshd) это лучший способ удовлетворить sshd требования абсолютного пути. В противном случае вы получите следующее сообщение об ошибке: sshd re-exec requires execution with an absolute path . Программа -p 10222 заставляет sshd прослушивать этот альтернативный порт, переопределяя файл конфигурации — это так, чтобы он не конфликтовал с потенциально работающими sshd экземплярами. Убедитесь, что выбрали свободный порт здесь.

Читайте также:  Замена сочетаний клавиш mac os

Наконец: подключитесь к альтернативному порту ( ssh -p 10222 user@server ).

Этот метод много раз помог мне в поиске проблем, будь то проблемы с аутентификацией или другие типы. Чтобы получить действительно подробный вывод stdout , используйте $(which sshd) -Ddddp 10222 (обратите внимание на добавленное dd для увеличения многословия). Для дополнительной проверки отладки man sshd .

Источник

Ssh exchange identification connection closed by remote host astra linux

When using SSH this error may show it’s ugly head on occasion. Many searches for the issues point to funny TCP connection tweaks or that sshd needs to be re-configured. This is not the case.

Symptoms

Connecting to SSH servers gives this message:

Or maybe this if using verbose mode.

Solutions

This can be caused by a number of issues, steps to test are as follows.

Check /etc/hosts.deny and /etc/hosts.allow

Many have reported configuring these to values properly has helped. However, we’ve seen this issue even when hosts.* files were not a factor.

Missing Dependencies

This one typically happens after a glibc or openssl upgrade. Many distros can install updates to glibc or openssl libs and not require a restart to sshd.

On any distro you can recognize it when after an update, then use lsof to see where sshd has open files. Some will be pointed to DEL, because those libs were deleted on update.

When an SSH connection comes in the sshd daemon forks and attempts to attach ( ld ) these lib files, and fails resulting in this error.

Corrupted Fingerprint / Keys

Some how one or the other of the fingerprints or keys has become corrupted (did you manually edit one of these files?). Remove the server-side fingerprint in the clients

/.ssh/known_hosts and try again. When you re-connect you will be prompted to accept the host identity again.

If you are able to access the machine another way you may want to back-out and re-create the server-side

Along the same lines as this issue, if the files /etc/ssh/*key* are removed and sshd is not restarted then this error will show up too. Check for the key files in the sshd configuration directory.

Heavy Server Load

Have also seen this happen when server was under heavy load from for example, brute force attack. Increase the amount of connections sshd can run.

Источник

SSH exchange identification: соединение закрыто удаленным хостом под Git bash

Я работаю в win7 и настраиваю git-сервер с sshd. Я!—2—>, а клон ssh://git@localhost/home/git/myapp.git на Cywgin правильно. Но мне нужен config git Cygwin опять же, я хочу git клонировать в Git Bash. Я бегу!—4—> и получить следующее сообщение

затем я бегу ssh -vvv git@localhost на Git Bash и получили сообщение

кажется, мои личные ключи имеют неправильный формат? И я обнаружил, что в закрытых ключах есть ровно 25 строк без BEGIN и END . Я смущен, почему он сказал Не ключ RSA1, я полностью гарантирую, что это ключ RSA 2.

любые советы приветствуются. кстати, я прочитал первые 3 страницы в Google об этой проблеме.

14 ответов

У меня была эта проблема сегодня, и я понимаю, что я был подключен к 2 differente networks (LAN и WLAN), я решил его просто отключить кабель от адаптера Ethernet. Я полагаю, что проблема вызвана тем, что ключ ssh связан с MAC-адресом моего беспроводного адаптера. Надеюсь, это вам поможет.

Я просто столкнулся с этим сегодня, и это было потому, что сервер, к которому я пытался подключиться, был перегружен обработкой. Таким образом, возможно, что сервер испытывает нехватку памяти или CPU голодает.

он разобрался со мной.

нажмите следующее на linux

убедитесь, что вы не подключаетесь к какой-либо VPN.

Если имя хоста не работает, попробуйте IP-адрес.

это происходит прямо сейчас, поэтому я должен сказать. Я пытаюсь ssh с моим именем хоста, и он не работает

это дает ошибку «ssh_exchange_identification: соединение закрыто удаленным хостом»

это работало один час назад.

но, и вот интересная часть, IP-адрес работает!

(конечно, фактический IP-адрес разные)

получил то же сообщение об ошибке. Выключение WiFi и включение его снова работали для меня.

Привет, я исправляю это на одной службе vps, перезапуская ее, иначе, если у вас есть консоль из вашей службы o любой другой способ запустить команду на удаленной машине, единственная команда, которую вы должны запустить, — это перезапустить демон ssh и наслаждаться!! : P

Читайте также:  Завис finder mac os

Я решил это после изменения переменной ssh port & MaxStartups в /etc/ssh / sshd_config на ,

Если все еще не работает, перезагрузите систему.

получил ту же ошибку при подключении к GitHub с ssh, когда я перемещаюсь с одного рабочего места на другое. согласно моей ситуации, кажется, что dns-серверы разных сетей могут получить различный ip-адрес github, а файл known_hosts не идентифицирует его, когда произошли изменения. Поэтому изменение dns или переключение исходной сети может работать.

вы можете получить «ssh_exchange_identification: соединение закрыто удаленным хостом», если ваш sshd сервис не работает!

если у вас есть доступ к серверу, проверьте, что у вас есть sshd сервис работает с:

и проверьте, что он прослушивает порт 22:

сегодня утром мы перенесли наш экземпляр/серверы хоста git в новый центр обработки данных и при подключении к обоим: VPN (из удаленного/дома) или когда в офисной сети я получил ту же ошибку и не смог подключиться к клонированию любого репозитория GIT.

Это поможет, если вы подключаетесь к некоторым или всем сервера через сервер прыгать.

/.файл SSH/config файл Мои настройки для подключения были:

что это означает, для любого соединения на основе SSH он будет подключаться к любому * сервер через данный переход хост-сервер за исключением/за счет игнорирования «ssh.somejumphost.my.company.com» сервер (поскольку мы не хотим подключаться к хосту перехода через сервер хоста перехода.

чтобы исправить проблему, все, что я сделал, это изменить конфигурацию, чтобы игнорировать сервер git:

Итак, теперь для подключения к mycompany-git.server.com делая git clone (git SSH url), я говорю SSH не использовать хост перехода для этих двух дополнительных экземпляров / серверов git.

для меня это было вызвано ограничением количества одновременных сеансов ssh. Я добавил два параметра ниже в /etc/ssh / sshd_config, а затем все сработало.

простая перезагрузка сервера решила проблему для меня. Попробуйте жесткую перезагрузку, если не работает после мягкой перезагрузки.

Источник

Ssh exchange identification connection closed by remote host astra linux

Fri Jan 04, 2008 11:27 pm

I have a few Mikrotiks that for some reason I am not able to SSH into. I can access them via telnet, winbox, ect..but when I try to ssh in, I get the following:

ssh_exchange_identification: Connection closed by remote host

For linux systems, I know this can be an issue if you have setup a hosts.allow or hosts.deny file, but I have no clue what could cause this for the Mikrotiks. I have tried stoping and starting the service with no help. I have lots of other Mikrotiks that are working with ssh with no problem.

Has anyone run into this before?

Re: SSH Problem: ssh_exchange_identification

Sat Jan 05, 2008 6:44 am

I have noticed that by stopping and starting the ssh service the problem temporarily goes away. The 3 devices that i have noticed this problem on so far are running 2.9.39

Re: SSH Problem: ssh_exchange_identification

Sat Jan 31, 2009 9:09 pm

ssh_exchange_identification: Connection closed by remote host

rb 433ah Routeros 3.20.

Re: SSH Problem: ssh_exchange_identification

Mon Feb 02, 2009 12:53 pm

Re: SSH Problem: ssh_exchange_identification

Thu Feb 05, 2009 4:45 am

RB433AH i update to version 3.18. for pcq problem. back to 3.13. when read 3.20 solve this problem install 3.20 and update firmware.. and fail ssh

at times the service responds, but I can not determine what makes it work or stop working

cpu using is at 50% (not saturation)
disable, enable, change port etc ssh service, no efect

client is always same.. putty from windows or ssh command line from linux box (both fail now)

winbox work perfect.. and change ssh port with winbox port and winbox work ok.

need configuration file?

i think reset all and configure complety solve the problem.. but have a complex configuration

Re: SSH Problem: ssh_exchange_identification

Fri Apr 10, 2009 2:55 pm

Re: SSH Problem: ssh_exchange_identification

Mon Apr 13, 2009 11:06 am

Re: SSH Problem: ssh_exchange_identification

Wed Apr 15, 2009 1:19 pm

$ ssh -vv link_mar31
OpenSSH_5.1p1 Debian-3ubuntu1, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to link_mar31 [172.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/identity type -1
debug1: identity file /home/user/.ssh/id_rsa type -1
debug1: identity file /home/user/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host
$

Читайте также:  Как отключить антивирус windows 10 через командную строку

from routeros 3.20:17
[admin@dude] > /system ssh 172.xxx.xxx.xxx user=admin port=22 ;
ssh_exchange_identification: Connection closed by remote host

Welcome back!
[admin@Hey dude] >

All devices are probed by dude every minute or so. When i reboot device, ssh works, and these errors begins after 1-2 days.
I disabled ssh on one of devices.

this is my dude ssh probe:

Re: SSH Problem: ssh_exchange_identification

Fri Apr 17, 2009 1:04 pm

Re: SSH Problem: ssh_exchange_identification

Mon May 25, 2009 2:24 am

I had the same problem. I fixed it when i turn on this packages: calea , isdn, radiolan, user-manager.
I have question to Normis, what package fixed this problem?

Sorry for my eng. lish

Re: SSH Problem: ssh_exchange_identification

Tue May 26, 2009 8:38 pm

I am having the same problem on an RB411, running 3.10

I know the first response would normally be to upgrade software, but it seems that conjurer was having the same problems with 3.22

Does anyone know yet what is causing this?

Re: SSH Problem: ssh_exchange_identification

Wed May 27, 2009 3:15 pm

Re: SSH Problem: ssh_exchange_identification

Mon Jun 01, 2009 11:43 am

I have had the same problem.

After upgrading to version 3.24 the problem dissapeared.

Re: SSH Problem: ssh_exchange_identification

Thu Jul 02, 2009 12:30 am

Hello,
we have the same problem on 2.9.51, 3.10, 3.15, 3.20, 3.22, 3.24 and of course 3.25.

Nothing help, only reboot the router.

Note: https not working too!

Re: SSH Problem: ssh_exchange_identification

Thu Jul 02, 2009 8:13 pm

Re: SSH Problem: ssh_exchange_identification

Tue Dec 08, 2009 1:37 pm

Re: SSH Problem: ssh_exchange_identification

Fri Apr 23, 2010 10:17 am

We have the same problem, after about an hour no more response on ssh.
Nothing changed under this time.

ROS 4.6 4.7. fail
ROS 5.0b1 . working

Re: SSH Problem: ssh_exchange_identification

Tue Jul 06, 2010 1:24 pm

Re: SSH Problem: ssh_exchange_identification

Tue Jan 11, 2011 3:11 am

Of the 39 routers I have set SSH and FTP up on; when I try to connect via SFTP I am getting this same error (ssh_exchange_identification: Connection closed by remote host) on 7 of them. The other 32 work just fine. Below I have listed the kind of router with software version that it is happening to.

x86 (PC router) v3.13
x86 (PC router) v3.13
x86 (PC rotuer) v3.30
? v2.9.51 — did not have a hand in setting this up originally
RB1000 v3.14
RB1000 v3.30
RB1000 v4.11

The working ones are all 333, 433, 433AH, 450, 450G, 493, 493AH, and 750G running os 2.9.50 to 4.13. I have checked the packages between working and non-working routers and there is nothing obvious that would lead me to believe there is a package problem, and from looking at my list this is happening on only my PC based routers and my RB1000s. Any insight as to what could be causing this would be nice and very appreciated.

Re: SSH Problem: ssh_exchange_identification

Fri Jan 14, 2011 3:01 am

I have a little more information that may help:

When I said this was a problem on all x86 and RB1000s I was wrong there. I have one RB1000 that is working. I checked to see what packages it is running and compared it to the ones that are not working. (See attached image)

The RB1000 that is working is shaded in green and I have marked what packages that are installed and active with an ‘x’ and the packages that are installed and disabled are marked with a ‘d’. Blank spaces mean that package is not installed at all.

The top of each row indicated the type of router and the OS version it is running.

Using FileZilla in Windows 7 I can manually connect to routers 1 and 5 with SFTP using a username and password for the account that the public SSH is key is setup for. (I have not tried using the public key in FileZilla) The error I get in FileZilla on the others is:

Error: Server unexpectedly closed network connection
Error: Could not connect to server

Checking the router log and the terminal screen in the routers does not give any additional information.

I really need some ideas on how I can get though this.

Источник

Оцените статью