如何使用LocalForward转发SSH配置中的多个端口?


10

我想转发多个端口。到目前为止,我的配置如下所示:

Host myhost
    Hostname 123.123.123.123
    IdentityFile ~/.ssh/id_myhost
    LocalForward 8811 localhost:8811
    IdentitiesOnly yes

除了8811,我还想转发端口6006。

Answers:


25

可以添加多行LocalForward

Host myhost
    Hostname 123.123.123.123
    IdentityFile ~/.ssh/id_myhost
    LocalForward 8811 localhost:8811
    LocalForward 6006 localhost:6006
    IdentitiesOnly yes

这是你想要的吗?

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.