On the remote machine:
- Check to see if you have a notebook configuration file
jupyter_notebook_config.py
- On linux this is typically located at
/home/USERNAME/.jupyter/jupyter_notebook_config.py
- On linux this is typically located at
- If you don't have this file, generate it with the command:
jupyter notebook --generate-config
- Set up a password with
jupyter notebook password
On the remote machine:
jupyter notebook --no-browser --port=8080
On your local machine:
ssh -N -L 8080:localhost:8080 <remote_user>@<remote_host>
- Open a web browser to http://localhost:8080/ and log in using your password
Edit the .bashrc
files on your local and remote machines with alias commands to make launching a notebook easier.
On the remote machine:
alias jnb="jupyter notebook --no-browser --port=8080"
On your local machine:
alias jnb="ssh -M -S jnb-socket -fNT -L 8080:localhost:8080 <remote_user>@<remote_host>; start http://localhost:8080/"
alias jnbchk="ssh -S jnb-socket -O check <remote_user>@<remote_host>"
alias jnbext="ssh -S jnb-socket -O exit <remote_user>@<remote_host>"