SSH転送を使用してhttpサービスにアクセスできない

SSH転送を使用してhttpサービスにアクセスできない

リモートサーバー(Tomcatが実行されている)のポートをマイコンピュータのローカルポートに転送しています。

リモートサーバーアドレスが次のようになっているとします。http://myremoteserver.com:8080、次のようにポートをlocalhostに転送します。

ssh -L 8080:myremoteserver.com:8080 -N ワトソン

注:MyremoteserverはWatsonを介してのみアクセスできます。

配信後にブラウザでlocalhost:8080を実行すると、出力を表示できます。ただし、ネットワーク(localhostのDNSはserver1)の他のコンピュータからブラウザ(server1:8080など)を介してこのローカルホストにアクセスしようとすると、まったくロードされません。

奇妙なことは、SSHを介したポート転送の代わりにローカルホストでTomcatを実行し、ネットワーク上の他のコンピュータserver1:8080からブラウザを介してアクセスすると機能することです。

助けてください。私はそれがiptablesで何かをしなければならないと思いましたが、それをオフにしても機能しません。

ベストアンサー1

この試み:

ssh -L *:8080:myremoteserver.com:8080 -N watson

man sshオプションから抜粋-L

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 listening port be bound for local use 
only, while an empty address or ‘*’ indicates that the port should be available from 
all interfaces.

おすすめ記事