SSH逆トンネリング後に別のコンピュータにポートをブロードキャスト

SSH逆トンネリング後に別のコンピュータにポートをブロードキャスト

トンネルを元に戻す方法を読んで、次のコマンドを使用しています。

ssh -f -N -T -R25565:localhost:25565 dns.mindfulhacker.tk

私のMinecraftサーバーを渡してください。私の他のサーバーは私のMinecraftサーバーに接続できますが、クライアントはIPを使用してそのサーバーに接続できません。dns.mindfulhacker.tk:255565

トンネルがこのように機能するようにするにはどうすればよいですか?

どちらのサーバーもUbuntu Server 12.04 LTSを実行し、クライアントはWindowsを実行します。 (クライアントがLinuxを使用している場合は、SSHを介してトンネリングを再度許可します。)

ベストアンサー1

sshd_configファイルでGatewayPorts機能を有効にする必要があります。

から抜粋sshd_config のマニュアルページ:

GatewayPorts
        Specifies whether remote hosts are allowed to connect to ports 
        forwarded for the client.  By default, sshd(8) 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 connect.  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 yes

メモ:sshdこのように変更した後は必ず再起動してください。

詳細と例については、前の記事を参照してください。

おすすめ記事