1.10.3標準
SSHサーバー上のlocalhost:9000への接続を、クライアントから到達できるweb.example.test:80へ転送する。
適切な指定はどれか。
× 不正解
-R remote_port:destination:destination_portは、SSHサーバー側で待ち受ける転送である。
詳細解説
誤り
ssh -L 9000:web.example.test:80 trainee@gateway.example.test-Lはクライアント側待受けであり、サーバー側localhostからの転送ではない。
-Lはクライアント側待受けである。
正しい
ssh -R 9000:web.example.test:80 trainee@gateway.example.test-RはSSHサーバー側に待受けを作り、接続をクライアント側から見える宛先へ渡す。
-Rがサーバー側9000からクライアント側宛先へ転送する。
誤り
ssh -D 9000:web.example.test:80 trainee@gateway.example.test-DはSOCKS proxyの待受けで、固定の転送先をこの構文では指定しない。
-DはSOCKS proxyの指定である。
誤り
ssh -p 9000 web.example.test trainee@gateway.example.test-pはSSH接続自体のポート番号である。
-pはSSH接続自体のportである。
実際に確かめる
一時的な検証環境で実行できる例です。
printf '%s\n' 'ssh -R 9000:web.example.test:80 trainee@gateway.example.test'期待される結果
ssh -R 9000:web.example.test:80 trainee@gateway.example.test理解のポイント
- -R
- サーバー側待受け
- -Lとの違い
確認時の注意
- 確認環境: OpenSSH port forwardingの構文確認
基礎のおさらい
リモート転送
-Rは逆向き接続や内部サービス公開の構成で使われる。
公開範囲
Gatewayのbind設定やGatewayPortsにより到達範囲が変わる。
問題IDKL-102-1157
確認環境OpenSSH port forwardingの構文確認
最終技術確認2026-08-20
誤り・権利侵害を報告