0
votes

I'm trying to connect to jupyter notebook running on my remote server. The code below has been working fine for days to forward the jupyter notebook running on the port on my ubuntu server to my mac. It stopped today. Does anyone know what the issue might be? Also does anyone know how I can just open the port on my ubuntu server so I wouldn't need the code below?

code:

ssh -L 8000:localhost:8888 [email protected]

Update:

code:

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

Message:

WARNING: The conda.compat module is deprecated and will be removed in a future release.
[I 14:11:23.334 NotebookApp] [nb_conda_kernels] enabled, 2 kernels found
[I 14:11:23.343 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[I 14:11:24.175 NotebookApp] Serving notebooks from local directory: /home/username
[I 14:11:24.175 NotebookApp] The Jupyter Notebook is running at:
[I 14:11:24.175 NotebookApp] http://localhost:8889/?token=d111b8540568567c80796a3be5cf53229fe38360b411a4dd
[I 14:11:24.175 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:11:24.178 NotebookApp] 

    To access the notebook, open this file in a browser:
        file:///run/user/1000/jupyter/nbserver-77790-open.html
    Or copy and paste one of these URLs:
        http://localhost:8889/?token=d111b8540568567c80796a3be5cf53229fe38360b411a4dd

Update:

code: ssh -L 8888:localhost:8889 [email protected]

message:

bind: Address already in use channel_setup_fwd_listener_tcpip: cannot listen to port: 8888 Could not request local forwarding.

3

3 Answers

0
votes

I encounter the same problem time to time. You can try restarting your remote jupyter server (the link contains information to kill existing server and start a new one). Or try a different port number. BTW please share the exact error you face with.

[https://coderwall.com/p/ohk6cg/remote-access-to-ipython-notebooks-via-ssh][1]

Change "ipython" with "jupyter" and make sure jupyter is installed both on remote machine and your machine.

ipython notebook --no-browser --port=8889

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

The issue seems to be that I needed to type localhost:8888 in to the browser on my local machine. I had been typing in the port I opened the jupyter notebook server on, on my remote machine so localhost:8889. Example

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

followed by

ssh -N -f -L localhost:8888:localhost:8889 [email protected]

bang head here.

0
votes

This is because you have already opened another Jupyter notebook using port 8888 on your local machine. So solution is simply choosing a different port number, e.g. 8890 or else except 8888 in your case.