在服務(wù)器上做如下操作
1)生成配置文件
$jupyter notebook --generate-config
2)生成密碼(后續(xù)寫配置文件幅狮、登錄Jupyter notebook需要)
打開python終端
In [1]: from IPython.lib import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:一些數(shù)字字母'
3)修改默認(rèn)配置文件
$vim ~/.jupyter/jupyter_notebook_config.py
進(jìn)行如下修改(這里可以自行配置):
c.NotebookApp.ip='*'
c.NotebookApp.password = 'sha1:一些數(shù)字字母'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8889 #隨便指定一個(gè)端口
c.IPKernelApp.pylab = 'inline'
可能還需要設(shè)置c.NotebookApp.token = ''
4)啟動(dòng)Jupter notebook
$jupyter notebook
5)遠(yuǎn)程訪問
此時(shí)應(yīng)該可以直接從本地瀏覽器直接訪問http://address_of_remote:8889就可以看到j(luò)upyter的登陸界面雇庙。(ps:服務(wù)器上的Jupyter notebook不要關(guān), 可以開啟screen會(huì)話創(chuàng)建一個(gè)jupyter專屬會(huì)話做到)