This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
en:programmation-jupyter [2020/12/15 16:09] admin |
en:programmation-jupyter [2022/03/11 19:23] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Jupyter | + | ====== Jupyter |
- | You should | + | It's best to secure your jupyter |
+ | The procedure also sets the port on which the server is running and preventing a web browser from starting.You can change the different options according to your needs. | ||
- | Create jupyter | + | ====== Initial |
- | jupyter notebook --generate-config | + | You only need to do this setup once, not everytime you want to use the lab. |
- | Create jupyter | + | First, we create a password. This way, it won't be a random key to login. |
- | + | jupyter | |
- | jupyter | + | |
- | + | Second, we create an SSL key. This key will allow the server to run as an https server. Keep in mind this is a self-signed | |
- | + | openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout | |
- | Create | + | |
- | + | ||
- | cd ~/.jupyter | + | |
- | openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout | + | |
- | + | ||
- | You can start jupyter with this command: | + | |
- | + | ||
- | jupyter notebook --certfile=~/ | + | |
- | + | ||
- | If you prefer to use a browser on a different machine, for example a laptop, you can use this command instead: | + | |
- | jupyter notebook | + | |
- | + | ||
- | This command won't automatically start a browser and will allow any computer to connect to the jupyter server. Look at the statup log to see which port to connect to. | + | |
- | + | ||
- | If you want this configuration to be permanent, you can add those options to the jupyter_notebook_config.py file. | + | |
- | < | + | |
- | echo " | + | |
- | echo " | + | |
- | echo " | + | |
- | echo " | + | |
- | </ | + | |
- | + | ||
- | You can then start jupyter with a shorter command. | + | |
- | jupyter notebook | + | |
- | + | ||
- | If you intend to use jupyter remotely from a laptop that's not on our network, you'll have to create an ssh tunnel to be able to reach the server. | + | |
+ | Third, we configure miscelaneous parameters of the lab | ||
+ | Certificate information | ||
+ | echo " | ||
+ | echo " | ||
+ | Don't start a browser | ||
+ | echo " | ||
+ | echo " | ||
+ | Run on port 9000. Change this if needed | ||
+ | echo " | ||
+ | Once the setup is complete, you can start the program as usual: | ||
+ | jupyter lab | ||
+ | ====== Remote access ====== | ||
+ | If you wish to start a lab server on a machine and access it remotely, do as usual and create an ssh tunnel to the port you defined in your configuration. For example: | ||
+ | ssh mydesktopname -L9000: | ||