Ssh – How to forward multiple ports in the SSH configuration with LocalForward

sshssh-tunneling

I want to forward multiple ports. So far my configuration looks like this:

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

I would like to forward port 6006 in addition to 8811.

Best Answer

It is possible to add multiple lines of LocalForward:

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

Is this what you want?

Related Question