SSH接続の問題:ssh_exchange_identification:リモートホストによって接続が終了しました。

SSH接続の問題:ssh_exchange_identification:リモートホストによって接続が終了しました。

sshを使用してdesktop1(画像の赤い矢印)から(下の画像を参照)に接続するのに問題があります。server常に次のように言います。

ssh_exchange_identification: Connection closed by remote host

desktop1でまたはでサーバーに接続するのに問題はありませdesktop2ん。desktop2serverdesktop1desktop2

サーバーとデスクトップ間のSSH接続の問題1

desktop1次のように一時sshdサーバーを作成して問題を解決しようとしました。

[desktop1]# $(which sshd) -Ddddp 4000

以下から接続してくださいserver

[server]# ssh -v -p 4000 root@desktop1
OpenSSH_7.1p2, OpenSSL 1.0.2g-fips  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: Executing proxy command: exec /usr/bin/sss_ssh_knownhostsproxy -p 4000 desktop1
debug1: permanently_set_uid: 0/0
debug1: permanently_drop_suid: 0
debug1: identity file /root/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type 2
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
ssh_exchange_identification: Connection closed by remote host
#

これはうまくいきません。

しかし、最初からdesktop2接続はうまくいきます。

[desktop2]# ssh -v -p 4000 root@desktop1
OpenSSH_7.1p2, OpenSSL 1.0.2g-fips  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: Executing proxy command: exec /usr/bin/sss_ssh_knownhostsproxy -p 4000 desktop1
debug1: permanently_set_uid: 0/0
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client [email protected] <implicit> none
debug1: kex: client->server [email protected] <implicit> none
debug1: kex: [email protected] need=64 dh_need=64
debug1: kex: [email protected] need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
[...]
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Last login: Mon Mar  7 15:24:05 2016 from 10.0.21.200
Environment:
  LANG=en_US.UTF-8
  USER=root
  LOGNAME=root
  HOME=/root
  PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
  MAIL=/var/mail/root
  SHELL=/bin/bash
  SSH_CLIENT=10.0.21.200 39150 4000
  SSH_CONNECTION=10.0.21.200 39150 10.0.21.204 4000
  SSH_TTY=/dev/pts/1
  TERM=xterm-256color
  DISPLAY=localhost:11.0
Running /usr/bin/xauth remove unix:11.0
/usr/bin/xauth add unix:11.0 MIT-MAGIC-COOKIE-1 2843404fd74f1294efce8c6bb786fd75

上記のファイルと同じです/etc/ssh/sshd_configdesktop1desktop2

ルートの公開/秘密鍵はserver、およびでdesktop1同じですdesktop2

以下のように、3台のコンピュータすべてに権限があります。

# ll .ssh/
total 24
-rw-------  1 root root 1883 Nov  6 09:33 authorized_keys
-rw-------. 1 root root  668 Jan 26  2015 id_dsa
-rw-r--r--. 1 root root  620 Jan 26  2015 id_dsa.pub
-rw-------. 1 root root  887 Jan 26  2015 id_rsa
-rw-r--r--. 1 root root  240 Jan 26  2015 id_rsa.pub
-rw-r--r--. 1 root root 1893 Nov  5 10:31 known_hosts

Tracerouteは次の2つのデスクトップを見つけましたserver

[server]# traceroute -T -p 22 desktop1
traceroute to desktop1 (10.0.21.204), 30 hops max, 60 byte packets
 1  gateway (10.0.21.30)  0.704 ms  0.874 ms  1.041 ms
 2  desktop1 (10.0.21.204)  0.325 ms  0.438 ms  0.407 m
[server]#
[server]# traceroute -T -p 22 desktop1
traceroute to desktop2 (10.0.21.200), 30 hops max, 60 byte packets
 1  gateway (10.0.21.30)  0.847 ms  0.985 ms  1.158 ms
 2  desktop2 (10.0.21.200)  0.286 ms  0.310 ms  0.314 ms

それでは、このID交換の問題の原因は何ですかssh_exchange_identification: Connection closed by remote host

ご協力ありがとうございます。

こんにちは、富士。

ベストアンサー1

問題は、次のために発生する可能性があります。

debug1: Executing proxy command: exec /usr/bin/sss_ssh_knownhostsproxy -p 4000 desktop1

/etc/ssh/ssh_configを編集し、ProxyCommand行をコメントアウトします。 FreeIPAにクライアントを参加させるときにこの問題が発生しました。

おすすめ記事