Use python you , Have you ever wanted to show your code without a computer ？ Or change a computer to use python Found that many packages are not easy to install ？ Or want to do it on the subway coding But mobile phones can't compile . Then follow this article to configure your own remote jupyter notebook, Whenever and wherever possible Python.
One is configured anaconda Server for （ No servers ？ You can click to see how to buy and configure ）
Basic programming knowledge
filezilla（ No installation ？ You can click to see how to use ）
Let's get started
First ssh Connect to your own server , Enter the following command
jupyter notebook --generate-config
If you are prompted
Running as root it not recommended. Use --allow-root to bypass.
jupyter notebook --generate-config --allow-config
After successful execution, the following information will be generated , In other words, a configuration file is generated in the displayed directory .
ipython Get into ipython
In turn, run
from notebook.auth import passwd
You will be prompted to enter your password twice , After input, a key will be generated , Be sure to copy and paste to other places for later use
Next input exit() sign out ipython, And on again filezilla Connect to your own server , Download the just generated py file . If you haven't touched the server , Then the file will be in the position shown in the figure
After downloading it locally, open it and find the following lines to modify （ Or pay attention to the official account ： Get up early python, reply ipython Get directly modified file ）
c.NotebookApp.password = 'sha1:1b4ea9662b35:3e3d6a823d264d466f125a0939623c05e7b66007'
c.NotebookApp.open_browser = False
The last step , Enter alicloud in the following order ecs Reception , Find security group rules , add to 8888 port
Come here , All configuration is done .
Go back to the command line , Input
jupyter notebook --allow-root Just like the picture below generation Table opened successfully
At this point in your mobile phone or computer input your ip:8888 Then enter the password you just set , If you successfully enter jupyter notebook It's done ！
Last , Although it is now possible to enter , But once the command line just turned off or ssh Broken , You can't use it , So we go back to the command line and press （control+c） close jupyter notebook. Reenter the following command to change notebook Run in the background , At this time, no matter turn off the computer or turn it off ssh It won't make any difference , Open this website anytime, anywhere coding 了 ！
nohup jupyter notebook --allow-root &