![SSH 전달을 사용하여 http 서비스에 액세스할 수 없습니다](https://linux55.com/image/41331/SSH%20%EC%A0%84%EB%8B%AC%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20http%20%EC%84%9C%EB%B9%84%EC%8A%A4%EC%97%90%20%EC%95%A1%EC%84%B8%EC%8A%A4%ED%95%A0%20%EC%88%98%20%EC%97%86%EC%8A%B5%EB%8B%88%EB%8B%A4.png)
원격 서버(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.