Calmcode - ssh: port-forward


1 2 3 4 5 6 7 8 9

You can also use ssh to forward ports. This is very useful when you want to run jupyterlab on the server and connect to it from the browser.

Here's the configuration used in the video for the ~/.ssh/config-file:

Host homeserver
    User vincent
    IdentityFile /Users/vincent/.ssh/id_demo_purposes
    LocalForward localhost:8888 localhost:8888

In general, you want to stick to the following recipe for ssh-config files.

Host <your-chosen-name>
    Hostname <ip-adress>
    User <username>
    IdentityFile <path-to-private-file>
    LocalForward <our-ip-adr>:<our-port> <server-ip-adr>:<server-port>

There are many extra settings that you can pass. But the most common extra setting is the LocalForward setting.