The iMac and Linux server in the laboratory have better specifications, so this is a setting memo when you can use the Jupyter Lab that you usually use remotely.
I referred to this Using jupyter lab remotely. Rather, it is almost as it is.
$ jupyter lab --generate-config
Writing default config to: /home/okuda/.jupyter/jupyter_notebook_config.py
$ ipython
Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.9.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from IPython.lib import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:xxxxxxxxx'
$ nano ~/.jupyter/jupyter_notebook_config.py
Then edit the necessary parts.
~/.jupyter/jupyter_notebook_config.py
c = get_config()
c.IPKernelApp.pylab = 'inline'
c.NotebookApp.open_browser = False
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.port = 9999
c.NotebookApp.allow_remote_access = True
c.NotebookApp.password = 'sha1:xxxx'
$ ssh -p port number[user]@[ip] -NL 9999:localhost:9999
Start Jupyter Lab and
http://localhost:9999/
It is OK if you access.
~/.ssh/config
Host xxx
HostName xxx
User xxx
Port xxx
IdentityFile ~/.ssh/id_rsa_xxx
LocalForward 9999 localhost:9999
It's convenient!
thank you for your hard work.
Recommended Posts