Brandon Rozek

Photo of Brandon Rozek

PhD Student @ RPI studying Automated Reasoning in AI and Linux Enthusiast.

SSH Local Port Forwarding

Published on

Updated on

There are some services that I don’t want to run all the time which makes me not want to open a port for it. One good example of this is Jupyter Notebooks. Therefore, what I sometimes do is run it locally and forward the port so that another machine can access it.

Example command:

ssh -L 8888:localhost:8888 -N

The -L flag allows you to specify the localsocket:host:remotesocket.

-N makes it so that it doesn’t execute any additional commands

Then finally you put the address of the machine you wish to connect to.

Was this useful? Feel free to share: Hacker News Reddit Twitter
Reply via Email

Have you published a response to this? :