回答:
いいえ、転送ポートごとに1 つのssh接続は必要ありません。-Lステートメントを追加するだけです。
ssh -L LPort1:RHOST1:RPORT1 -L LPORT2:RHOST2:RPORT2 me@ju.mp.ho.st
次のように一致するセクションを設定すると、ssh jump「エイリアス」を使用してこれをに短縮できます。jump~/.ssh/config
Host jump
User myUserName
Hostname ju.mp.ho.st
Port 2345
LocalForward 8080 remotewebserver:8080
LocalForward 8443 remotewebserver:8443
LocalForward 8923 remotewebserver:8923
LocalForward 8181 remotewebserver:8181
# Eliminates reconnection delay, and does not try to re-forward ports:
Host *
ControlMaster auto
ControlPath /tmp/%r@%h:%p
私は長年この手法を使用してきましたが、確かにすでに10個以上のポートを備えていますが、転送するポートがさらに必要な場合は、Dynamic Socks Proxyサポートを使用します-D。
bind: Address already in use channel_setup_fwd_listener_tcpip: cannot listen to port:次にCould not request local forwarding.、Control *設定を使用すると、これらのメッセージが表示されなくなります。PS:私はそのコメントフラグをSEで頻繁に使用しており、あなたも私がこれを使用した最初の人です。:)