Skip to content

Instantly share code, notes, and snippets.

@Swarchal
Last active February 16, 2017 12:12
Show Gist options
  • Save Swarchal/dba8a84ce46f3b6e0dbbb79e4c316c5f to your computer and use it in GitHub Desktop.
Save Swarchal/dba8a84ce46f3b6e0dbbb79e4c316c5f to your computer and use it in GitHub Desktop.
start remote jupyter notebook server over ssh
#!/bin/bash
# start a jupyter server running on a remote host
# and port-forward to local machine
remote_host=$1
terminal=x-terminal-emulator
# start remote jupyter session on port:8889
$terminal ssh $remote_host "ipython notebook --no-browser --port=8889"
# port-forwarding to localhost:8888
ssh -N -f -L localhost:8888:localhost:8889 $remote_host
# open in default web-browser
xdg-open http://localhost:8888
@Swarchal
Copy link
Author

Remember to close port forwarding on remote host afterwards!!

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