SirYansalot
SirYansalot

Reputation: 53

Trying to access remote jupyter notebook via ssh tunnel

I need some help accessing a remote jupyter notebook instance

normally, when I am trying to access a jupyter notebook running on a remote server on my mac, I will write the following in a terminal window to create the tunnel

ssh -NL $local_port_number:localhost:$remote_port_number $my_username@$remote_server

afterwards, I can usually access the jupyter server at http://localhost:local_port_number

how do I do this in putty on windows? I know there is some option in connection>>ssh>>tunnels to do this, but I cannot get the configuration to work so far.

Upvotes: 5

Views: 11882

Answers (2)

aerin
aerin

Reputation: 22694

In remote host, open the terminal, change directory to where you have your notebooks and type:

jupyter notebook --no-browser --port=8889

# you should leave the this open

In your local computer, open MS-DOS cmd (if using Windows) or Unix terminal, then type:

ssh -N -f -L localhost:8888:localhost:8889 username@your_remote_host_name

# make sure to change `username` to your real username in remote host
# change `your_remote_host_name` to your address of your working station
# Example: ssh -N -f -L localhost:8888:localhost:8889 [email protected]

Now open web browser (google chrome, firefox, ...) and type:

localhost:8888
# you will see your notebooks in your given directory

From: http://amber-md.github.io/pytraj/latest/tutorials/remote_jupyter_notebook

Upvotes: 4

CloudTodd
CloudTodd

Reputation: 103

To access Jupyter over the SSH tunnel on Windows you will need to 1) initiate the tunnel in Putty and 2) configure your web browser to send traffic over the tunnel.

To Initiate the tunnel in Putty: 1) Navigate to Connection-->SSH-->Tunnels 2) Put in the local address for which you want to forward traffic 3) Click the 'Dynamic' radio button 4) Click the 'Add' button 5) Click the 'Open' button to initiate the connection

For Chrome and Internet Explorer 1) Use the Start->Run menu to run inetcpl.cpl 2) In the 'Connections' tab click 'LAN Settings' 3) Click on the 'Use a proxy server for your LAN' check box 4) Click 'Advanced' 5) In the 'Socks' field type '127.0.0.1' and add the port that you chose above 6) Apply these changes by clicking the 'Ok' button

You should now be able to access Jupyter over the SSH tunnel.

Upvotes: 0

Related Questions