"로컬 포트 포워딩"과 "동적 포트 포워딩"의 차이점을 이해하려고합니다.
"로컬 포트 전달"에 대한 ssh 명령에서 항상 대상 호스트를 지정해야합니까?
"동적 포트 전달"의 "동적"은 "동적 포트 전달"에 대한 ssh 명령에서 대상 호스트를 지정할 필요가 없음을 의미합니까? 그렇다면 목적지는 언제 지정됩니까?
예, 로컬 포워딩을 사용할 때 대상 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.
를 사용 -L
하면 SSH는 트래픽을 이해하려고하지 않습니다. 로컬 포트에서 수신하는 모든 것을 대상 포트로 보냅니다. 연결이 설정 될 때 대상 포트를 결정합니다. 를 사용 -D
하면 SSH가 프록시 서버 역할을하므로 여러 포트의 연결을 처리 할 수 있습니다 (예 : SOCKS 프록시로 사용하도록 구성된 브라우저는 동일한 연결을 통해 HTTP, HTTPS, FTP 등에 액세스 할 수 있음). 다른 프록시 서버와 마찬가지로 트래픽을 사용하여 목적지를 결정합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다