
プロキシ サーバーがどのように機能するかは理論的にはよくわかっていますが、実際にやってみると、どうもうまくいきません。
管理 IP と同じネットワーク内に SOCKS プロキシを構成して、ユーザーから抽象化する必要があります。推奨される OS を展開できる vCenter クラスターがありますが、簡略化するために、セットアップは次のとおりです。
- ストレージ システム管理 IP = 10.244.244.15
- SUSE11 VM IP = 10.244.244.10
- Windows XP IP = 10.244.244.5
SUSE システムでは を実行しましたssh -ND 1080 <user>@<storage mgmt ip>
が、エンドツーエンドの接続は実現されませんでした。
tcpdump
当時、同じポートで を実行していたところ、いくつかのトラフィックが試行されているのを確認しました。
17:42:26.669953 IP 10.x.x.x.54214 > x.x.com.socks: S 3287828135:3287828135(0) win 5840 <mss 1460,sackOK,timestamp 6708230 0,nop,wscale 6>
17:42:26.669968 IP x.x.com.socks > 10.x.x.x.54214: R 0:0(0) ack 3287828136 win 0
全体的な質問:
- それほど重要ではありませんが、上記で何をしたでしょうか?
- さらに重要なのは、この環境で SOCKS プロキシをどのように構成できるかということです。
答え1
SSHD Config の GatewayPorts 設定により、SSH 接続はループバック インターフェイス (127.0.0.1) のみでリッスンしている可能性があります。GatewayPorts が yes に設定されている場合、コマンドは機能します。
netstat -an | grep LISTEN
パブリックインターフェースでリッスンしているかどうかが表示されます。パブリックインターフェースでリッスンするように強制するには、
ssh -ND <ip address>:<port> <user>:<host>
ただし、GatewayPorts が許可している場合のみです。
GatewayPorts
Specifies whether remote hosts are allowed to connect to ports
forwarded for the client. By default, sshd binds remote port
forwardings to the loopback address. This prevents other remote
hosts from connecting to forwarded ports. GatewayPorts can be
used to specify that sshd should allow remote port forwardings to
bind to non-loopback addresses, thus allowing other hosts to con-
nect. The argument may be "no" to force remote port forwardings
to be available to the local host only, "yes" to force remote
port forwardings to bind to the wildcard address, or
"clientspecified" to allow the client to select the address to
which the forwarding is bound. The default is "no".
私の推測では、GatewayPorts はデフォルトの no に設定されていると思います。これを yes (で) に変更する/etc/ssh/sshd_config
と、ssh コマンドは変更されずに動作するはずですが、念のため、インターフェイスの IP アドレスを使用して特定することもできます。
注意: これに加えて、着信接続をブロックする iptables ルールがないことも確認する必要があります。
のようなsshプロキシは動作しますが、かなり遅くなる可能性があります(暗号化のオーバーヘッド)。次のような専用のsocksプロキシを検討することをお勧めします。ソックス。