这在命令行中有效。
ssh -i ~/.ssh/id_rsa x.x.x.x -p 22 -R <IP1>:10001:localhost:9090 -R <IP2>:10001:localhost:22
但是当使用 ssh 配置文件时,它会失败。以下是配置文件的内容。
Host decryptor
HostName x.x.x.x
User sshtunnel
Port 10022
IdentityFile ~/.ssh/id_rsa
RemoteForward <IP1>:10001 localhost:9090
RemoteForward <IP2>:10001 localhost:22
我们从调试中得到的错误。
debug1: Authentication succeeded (publickey).
Authenticated to x.x.x.x ([x.x.x.x]:10022).
debug1: Remote connections from <IP1>:10001 forwarded to local address localhost:22
debug1: Remote connections from <IP2>:10001 forwarded to local address localhost:9090
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: remote forward success for: listen <IP1>:10001, connect localhost:22
debug1: remote forward failure for: listen <IP2>:10001, connect localhost:9090
Error: remote port forwarding failed for listen port 10001
有任何想法吗?