Skip to content

Instantly share code, notes, and snippets.

@molpopgen
Last active February 19, 2022 22:05
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save molpopgen/3267efe08a0a4c23835249a955db37a2 to your computer and use it in GitHub Desktop.
Save molpopgen/3267efe08a0a4c23835249a955db37a2 to your computer and use it in GitHub Desktop.
SSH port forwarding and Jupyter

Problem

You want to use Jupyter remotely. X11 forwarding is too slow for this.

Solution

SSH port forwarding!

The recipe

On your server

cd directory
#Map a jupyter process to port 8889 on server
jupyter notebook --no-browser --port=8889

Note: Port number is semi-arbitrary. Just avoid any existing services! :)

On your client

#Map port 8888 on your client to 8889 on the remote host:
ssh -N -f -L localhost:8888:localhost:8889 $LINUXBOX

Then, navigate your browser to URL localhost:8888

@azartamboli
Copy link

Hi,

when I connected through client machine it asking me for the token and when I entered token it says invalid credential..What could be the issue? I have confirm the token also and also tried same for password as well. Can anyone help me here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment