何らかの理由でSSHジャンプホストオプションが機能しない

何らかの理由でSSHジャンプホストオプションが機能しない

sshのジャンプホストオプションを利用しようとしていますが、何らかの理由で機能せずに次のような結果を得ます。

$ ssh -J user1@host1 user2@target
kex_exchange_identification: banner line contains invalid characters
banner exchange: Connection to UNKNOWN port 65535: invalid format
$ ssh -J user1@host1:22 user2@target:22
channel 0: open failed: connect failed: Name or service not known
stdio forwarding failed
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535

理由を知りたいです。ユーザーのラップトップからsshを介してホスト1にログインし、ホスト1からターゲットにログインできます。キーもすべて設定しました。混乱しています。私は何を見逃していますか?

これを追加した後、-v次のことを観察できます。

debug1: kex_exchange_identification: banner line 39: \033[?25h\033[?7hSSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
kex_exchange_identification: banner line contains invalid characters
banner exchange: Connection to UNKNOWN port 65535: invalid format
debug1: channel 0: free: direct-tcpip: listening port 0 for target port 22, connect from 127.0.0.1 port 65535 to UNKNOWN port 65536, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Killed by signal 1.

LANの他のホストでは正しく接続できますが、targetこのssh -J user1@host1 user2@targetホストだけは接続できないようです。

行をに変更すると、ssh -J user1@host1:22 user2@target:22 -v次の結果が表示されます。

debug1: client_input_hostkeys: no new or deprecated keys from server
debug1: Remote: /home/user1/.ssh/authorized_keys:3: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /home/user1/.ssh/authorized_keys:3: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
channel 0: open failed: connect failed: Name or service not known
stdio forwarding failed
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535

何をしたいですかport 65535?また、ssh経由でアクセスしてhost1次のことを行いました。

netcat target 22
SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3

touch ~/.hushloginより多くのsを加え、-v加えた後-vvv私達は得ます。

debug2: channel 0: open confirm rwindow 2097152 rmax 32768
debug1: kex_exchange_identification: banner line 39: \033[?25h\033[?7hSSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
kex_exchange_identification: banner line contains invalid characters
banner exchange: Connection to UNKNOWN port 65535: invalid format
debug3: send packet: type 1
debug1: channel 0: free: direct-tcpip: listening port 0 for ghnvm port 22, connect from 127.0.0.1 port 65535 to UNKNOWN port 65536, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 direct-tcpip: listening port 0 for ghnvm port 22, connect from 127.0.0.1 port 65535 to UNKNOWN port 65536 (t4 r0 i0/0 o0/0 e[closed]/0 fd 4/5/-1 sock -1 cc -1)

debug1: fd 0 clearing O_NONBLOCK
debug3: fd 1 is not O_NONBLOCK
Killed by signal 1.

ssh -oProxyCommand='ssh -p22 user1@host1 -W %h:%p' -p22 user2@target返されます:

kex_exchange_identification: banner line contains invalid characters
banner exchange: Connection to UNKNOWN port 65535: invalid format

ベストアンサー1

おすすめ記事