LoginSignup
22
12

More than 5 years have passed since last update.

ssh_exchange_identification: Connection closed by remote host と言われたときにクライアント側でできる対処

Posted at

家のネット回線を変えてからsshしたときに

$ ssh hoge
ssh_exchange_identification: Connection closed by remote host

と言われました。
このようなとき、クライアント側で~/.ssh/known_hostsを削除すると、再び接続できるようになりました。

$ rm ~/.ssh/known_hosts
$ ssh hoge
The authenticity of host 'x.x.x.x (y.y.y.y)' can't be established.
RSA key fingerprint is xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'x.x.x.x' (RSA) to the list of known hosts.
<<正常にログインできる>>

おそらく、known_hostsに前の接続情報が残っていてコンフリクトを起こしたのでしょう。

なお、他の原因として、サーバ側で/etc/hosts.allowをいじったことなどもありますが、この辺はググってみてください。

22
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
12