SSHポート転送で「bind_address」とはどういう意味ですか?

SSHポート転送で「bind_address」とはどういう意味ですか?

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.  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 a connection is made to host port hostport from the remote machine.  Port
         forwardings can also be specified in the configuration file.  IPv6 addresses can be specified by enclosing the address in square brackets.
         Only the superuser can forward privileged ports.  By default, the local port is bound in accordance with the GatewayPorts setting.  However,
         an explicit bind_address may be used to bind the connection to a specific address.  The bind_address of “localhost” indicates that the listen‐
         ing port be bound for local use only, while an empty address or ‘*’ indicates that the port should be available from all interfaces.

「ヌルアドレスまたは*ポートがすべてのインターフェイスで使用可能であることを示します」の「すべてのインターフェイス」とはどういう意味ですか? localhostが複数のネットワークインターフェイスを持つことができ、ポートがportlocalhostのすべてのネットワークインターフェイスと動作している場合、localhostのすべてのネットワークインターフェイスを意味しますか?

「バインドアドレスは、localhost受信ポートがローカル専用であることを意味します。」で、「ローカル使用のみ」とは、ローカルホストの特定のネットワークインターフェイスを意味しますか?

bind_addresslocalhostではなくホストのネットワークインターフェースを参照できますか?

ベストアンサー1

一般的に言えば、アドレスバインディングサービス(SSHなど)とIPアドレス間の接続。

ホストには複数のIPアドレス(127.0.0.1、192.168.1.2など)があります。アドレスバインディングを使用すると、一部またはすべてのアドレスでサービスを実行できます。

ホストが 2 つのネットワークインターフェイスで構成されているとします。 1 つは信頼できるネットワーク (192.168.1.0/24 など) に接続され、もう 1 つは信頼できないネットワーク (192.168.2.0/24 など) に接続されます。ホストが信頼できるネットワークでのみSSH接続を許可したいとします。この場合、SSHサービスを信頼できるネットワーク(192.168.1.2など)のホストアドレスにバインドするだけです。

localhostasを使用すると、bind_addressローカルシステムで実行されているSSHクライアントのみがSSHサービスに接続できます。

おすすめ記事