This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:programmation-jupyter [2020/02/06 20:20] admin created |
en:programmation-jupyter [2022/03/11 19:23] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Jupyter | + | ====== Jupyter |
- | Veuillez sécuriser votre notebook en utilisant la procédure qui suit. | + | It's best to secure your jupyter lab with a password and an SSL certificate so the communication is crypted. |
+ | 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. | ||
- | création du fichier de configuration | + | ====== Initial |
- | jupyter notebook --generate-config | + | You only need to do this setup once, not everytime you want to use the lab. |
- | Création du mot de passe pour le notebook. | + | First, we create a password. This way, it won't be a random key to login. |
+ | jupyter lab password | ||
+ | |||
+ | 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 certificate and as such is not recognized by the browsers as being secure. | ||
+ | openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $HOME/ | ||
- | jupyter notebook password | + | Third, we configure miscelaneous parameters of the lab |
- | Création d'un certificat qui est valide pour 365 jours. Ajustez la durée selon les besoins. | + | Certificate information |
+ | echo " | ||
+ | echo " | ||
+ | Don't start a browser | ||
+ | echo " | ||
+ | echo " | ||
+ | Run on port 9000. Change this if needed | ||
+ | echo " | ||
- | cd ~/.jupyter | + | Once the setup is complete, you can start the program as usual: |
- | | + | |
- | Vous pouvez maintenant démarrer jupyter comme suit: | + | ====== Remote access ====== |
- | jupyter notebook --certfile=~/ | + | 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 | ||
- | Si vous préférer utiliser un navigateur web sur un autre ordinateur pour se connecter au serveur jupyter, vous pouvez utiliser cette commande: | ||
- | jupyter notebook --certfile=~/ | ||
- | Cette commande ne démarrera pas de navigateur web en même temps que le serveur et autorise n' | ||
- | |||
- | Si vous voulez que cette configuration soit permanente, vous pouvez modifier le fichier jupyter_notebook_config.py. | ||
- | < | ||
- | echo " | ||
- | echo " | ||
- | echo " | ||
- | echo " | ||
- | </ | ||
- | |||
- | Vous pourrez maintenant démarrer le notebook comme suit: | ||
- | jupyter notebook | ||
- | |||
- | Si vous avez l' | ||
- | |||
- | Par exemple | ||
- | ssh -L 4444: | ||
- | |||
- | avec votre propre nom d' |