「ローカルポート転送」と「動的ポート転送」の違いは何ですか?

「ローカルポート転送」と「動的ポート転送」の違いは何ですか?

「ローカルポート転送」と「動的ポート転送」の違いを知りたいです。

「ローカルポート転送」sshコマンドで常にターゲットホストを指定する必要がありますか?

「動的ポート転送」の「動的」とは、「動的ポート転送」のsshコマンドでターゲットホストを指定する必要がないことを意味しますか?それでは、指定目的地はいつですか?

ベストアンサー1

はい、ローカル転送を使用する場合は、宛先IPとポートを指定する必要があります。 ~からman ssh:

 -L [bind_address:]port:host:hostport
         Specifies that the given port on the local (client) host is to be
         forwarded to the given host and port on the remote side.

明らかに、バインディングアドレスのみオプションです。

いいえ。動的転送を使用するときは、ターゲットホストまたはポートを指定できません。動的配信では、SSHはSOCKSプロキシとして機能します。またマンページで(強調):


 -D [bind_address:]port
         Specifies a local “dynamic” application-level port forwarding.
         This works by allocating a socket to listen to port on the local
         side, optionally bound to the specified bind_address.  Whenever a
         connection is made to this port, the connection is forwarded over
         the secure channel, and the application protocol is then used to
         determine where to connect to from the remote machine.  Currently
         the SOCKS4 and SOCKS5 protocols are supported, and ssh will act
         as a SOCKS server.

使用される場合、-LSSH はトラフィックを理解しようとしません。これは、単にローカルポートで受信されたすべてを接続を確立するときに決定する宛先ポートに送信します。 SSHを使用すると、-DSSHはプロキシサーバーとして機能し、複数のポートの接続を処理できます。たとえば、SSHをSOCKSプロキシとして使用するように設定されたブラウザは、同じ接続を介してHTTP、HTTPS、FTPなどにアクセスできます。他のプロキシサーバーと同様に、トラフィックを使用して宛先を決定します。

おすすめ記事