所以这对我来说很管用:
ssh -v -L 8080:remotewebserver:8080 me@jumphost如果我也想包括更多的港口呢?
我不仅要转发8080,还要转发8443,8923和8181?
我需要为每个端口做一个新连接吗?
发布于 2015-08-17 13:57:13
不,每个转发端口不需要一个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+端口一起使用了,但是当我需要更多的端口转发时,我使用了动态Socks代理支持-D。
https://unix.stackexchange.com/questions/223709
复制相似问题