ssh -L forward multiple ports <p>I'm currently running a bunch of:</p> <pre><code>sudo ssh -L PORT:IP:PORT root@IP </code></pre> <p>where IP is the target of a secured machine, and PORT represents the ports I'm forwarding.</p> <p>This is because I use a lot of applications which I cannot access without this forwarding. After performing this, I can access through <code>localhost:PORT</code>.</p> <p>The main problem occured now that I actually have 4 of these ports that I have to forward.</p> <p>My solution is to open 4 shells and constantly search my history backwards to look for exactly which ports need to be forwarded etc, and then run this command - one in each shell (having to fill in passwords etc).</p> <p>If only I could do something like:</p> <pre><code>sudo ssh -L PORT1+PORT2+PORT+3:IP:PORT+PORT2+PORT3 root@IP </code></pre> <p>then that would already really help.</p> <p>Is there a way to make it easier to do this?</p>