オープナーを使用したHTTPプロキシによるSSH

オープナーを使用したHTTPプロキシによるSSH

HTTPプロキシの背後にあるSSHを使用してCygwin端末から自宅のRaspberry Piに接続するのに問題があります。それはうまくいきました™、数日前から何が変わったのかわかりません(おそらくプロキシフィルタリング?)。オープナーなしでプロキシネットワークの外部から接続できます。

クライアントに関する限り、私のSSH設定は次のとおりです。

Host *
        ServerAliveInterval 60
        ProxyCommand /bin/corkscrew http.proxy.here 80 %h %p

接続しようとすると、次のようになります。

blx@proxyed-pc:~$ ssh [email protected] -v
OpenSSH_7.9p1, OpenSSL 1.0.2p  14 Aug 2018
debug1: Reading configuration data /home/blx/.ssh/config
debug1: /home/blx/.ssh/config line 1: Applying options for *
debug1: Executing proxy command: exec /bin/corkscrew http.proxy.here 80 my.home.ip 22
debug1: identity file /home/blx/.ssh/id_rsa type -1
debug1: identity file /home/blx/.ssh/id_rsa-cert type -1
debug1: identity file /home/blx/.ssh/id_dsa type -1
debug1: identity file /home/blx/.ssh/id_dsa-cert type -1
debug1: identity file /home/blx/.ssh/id_ecdsa type 2
debug1: identity file /home/blx/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/blx/.ssh/id_ed25519 type -1
debug1: identity file /home/blx/.ssh/id_ed25519-cert type -1
debug1: identity file /home/blx/.ssh/id_xmss type -1
debug1: identity file /home/blx/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
ssh_exchange_identification: Connection closed by remote host

サーバー側では、/var/log/auth は以下を報告します。

Nov 26 13: 39:36 raspi sshd[19130]: debug1: Forked child 19699.
Nov 26 13: 39:36 raspi sshd[19699]: debug1: Set /proc/self/oom_score_adj to 0
Nov 26 13: 39:36 raspi sshd[19699]: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8
Nov 26 13: 39:36 raspi sshd[19699]: debug1: inetd sockets after dupping: 3, 3
Nov 26 13: 39:36 raspi sshd[19699]: debug1: getpeername failed: Transport endpoint is not connected
Nov 26 13: 39:36 raspi sshd[19699]: debug1: ssh_remote_port failed

$corkscrew http.proxy.here 80 my.home.ip 22そのため、TCP接続が失われたようですが、コルク抜けで直接接続しようとすると、このような問題は発生しないようです(例:)。

Nov 26 13: 39:32 raspi sshd[19130]: debug1: Forked child 19698.
Nov 26 13: 39:32 raspi sshd[19698]: debug1: Set /proc/self/oom_score_adj to 0
Nov 26 13: 39:32 raspi sshd[19698]: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8
Nov 26 13: 39:32 raspi sshd[19698]: debug1: inetd sockets after dupping: 3, 3
Nov 26 13: 39:32 raspi sshd[19698]: Connection from http.proxy.here port 28220 on 192.168.0.11 port 22
Nov 26 13: 39:32 raspi sshd[19698]: Did not receive identification string from http.proxy.here port 28220

しかし、もちろんsshdは何をすべきかわかりません...

どんな提案がありますか?設定で何も変更していないようで、プロキシ フィルタリング ポリシーのこっそり更新が原因で問題が発生したようです。これ状況はわかりますが、確かにわかりません。家に着いたら、ポート443を使用するようにルーターとPiを更新してみましょう。

ベストアンサー1

我々は、特定のセキュリティ対策を迂回する意図がなく、この接続方法が間違いなくいかなる契約/合意にも違反しないことに同意する必要があります。医師の法的免責事項が完了しました。もし私があなたなら、実際に他のサーバーよりもうまく動作するポート443でSSH接続をリッスンするようにサーバーを切り替えようとします(Webプロキシを介している場合)。理由は簡単です。

  • ポート80(一般的なWebトラフィック)の通信は暗号化されておらず、ほとんどがプレーンテキスト(ページを読むとき)ですが、ポート443はSSL暗号化通信に使用されます。エージェントはこのポートを介したバイナリ形式の通信を見て驚かないでしょう。 Webページとは異なり、SSHにはバイナリ接続が必要です。
  • よく知られているポート(22など)を使用してサーバーを一般に公開しません(相手にIPホワイトリストファイアウォールがない場合)。新しいサーバーが検出されず、5分以内にオンラインになることがあります。その後、どこかにいる誰かがポート22が開いているのを見て、SSH経由でログインしようとします。ポート443は多くのセキュリティを追加しませんが、22よりも目立たない程度です。頑張ってください!

おすすめ記事