機能しないSSHトンネルをデバッグする方法(SSH自体は機能します)

機能しないSSHトンネルをデバッグする方法(SSH自体は機能します)

MacOSでVNCとSMBを使用したSSHトンネリングについてAsk Differentに質問を投稿しました。 Macに固有のものだと思いましたが、そうではありません。つまり、A が B と同じ LAN にあり、A が LAN の外にある場合、コンピュータ A からコンピュータ B (両方の Mac) で SSH を実行できます。同じLANにいる場合は、VNCとSMBを介してAからBに接続することもできます。ただし、LANにいないときにVNCまたはSMBトンネルを確立するためにAからBへのSSHトンネルを開こうとすると、接続は失敗します。

% ssh -L 1445:127.0.0.1:445 -L 15900:127.0.0.1:5900 -p 2216 -v myhost正しいコマンドとURLを使用していることを確認しましたvnc://127.0.0.1:15900。また、詳細なSSHロギングを有効にしました(SSH経由で接続したときに発生する現象)。

debug1: Local connections to LOCALHOST:1445 forwarded to remote address 127.0.0.1:445
debug1: Local forwarding listening on ::1 port 1445.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 1445.
debug1: channel 1: new [port listener]
debug1: Local connections to LOCALHOST:15900 forwarded to remote address 127.0.0.1:5900
debug1: Local forwarding listening on ::1 port 15900.
debug1: channel 2: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 15900.
debug1: channel 3: new [port listener]
debug1: channel 4: new [client-session]

これは失敗したVNC接続で発生します。

debug1: Connection to port 15900 forwarding to 127.0.0.1 port 5900 requested.
debug1: channel 5: new [direct-tcpip]
debug1: Connection to port 15900 forwarding to 127.0.0.1 port 5900 requested.
debug1: channel 6: new [direct-tcpip]
debug1: channel 5: free: direct-tcpip: listening port 15900 for 127.0.0.1 port 5900, connect from 127.0.0.1 port 51566 to 127.0.0.1 port 15900, nchannels 7
debug1: Connection to port 15900 forwarding to 127.0.0.1 port 5900 requested.
debug1: channel 5: new [direct-tcpip]
debug1: channel 6: free: direct-tcpip: listening port 15900 for 127.0.0.1 port 5900, connect from 127.0.0.1 port 51567 to 127.0.0.1 port 15900, nchannels 7
debug1: channel 5: free: direct-tcpip: listening port 15900 for 127.0.0.1 port 5900, connect from 127.0.0.1 port 51569 to 127.0.0.1 port 15900, nchannels 6

以下は、接続試行に基づいてフィルタリングされたBのsyslogです。

2023-08-18 08:52:05.095119+0200 0xe3cc3b   Default     0x0                  98235  0    screensharingd: SendAuthenticationInfoMessage
2023-08-18 08:52:05.126178+0200 0xe3cc3b   Default     0x0                  98235  0    screensharingd: HandleViewerAuthenticationMessages 2
2023-08-18 08:52:05.126193+0200 0xe3cc3b   Default     0x0                  98235  0    screensharingd: SendRSAResponseSRPAuthentication
2023-08-18 08:52:05.306678+0200 0xe3cc3b   Default     0x0                  98235  0    screensharingd: HandleViewerAuthenticationMessages 10
2023-08-18 08:52:05.306684+0200 0xe3cc3b   Default     0x0                  98235  0    screensharingd: SendRSAResponseSRPAuthentication

このログには明らかな問題はありません。そうですか?問題をデバッグするには、次に何をすべきですか?

ベストアンサー1

おすすめ記事