Last active
October 26, 2022 09:25
-
-
Save sepastian/851720529c37c2932d21396138866a39 to your computer and use it in GitHub Desktop.
Jupyter notebook on remote host via SSH tunnel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSH into remote host "R", startup Jupyter on port XXXX. | |
ssh [email protected] | |
jupyer notebook --no-browser --port=XXXX | |
# On the localhost "L", accessing jupyter via the browser: | |
# create a reverse tunnel, forwarding YYYY (L) to XXXX (R). | |
ssh -N -L YYYY:localhost:XXXX [email protected] | |
---- --------- ---- | |
| | | | |
| | ` port on remote where Jupyer is listening | |
| ` same hostname on local and remote machine | |
` local port, forwarded to remote port via SSH | |
# Jupyter protects access to notebooks with a token. | |
# To find out the token, SSH into R from L, then list all servers. | |
ssh [email protected] | |
jupyter notebook list | |
# Now simply click on the link named http://localhost:XXXX/?token=... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment