远程连接服务器Jupyter-notebook

远程连接服务器Jupyter-notebook

1、生成密码的Hash值

首先登录服务器,运行ipython

from notebook.auth import passwd
password()

然后连续输入两次密码(就是客户端远程连接时输入的密码)

Enter password:
Verify password:
[NotebookPasswordApp] Wrote hashed password to       /root/.jupyter/jupyter_notebook_config.json

会产生一个Hash值:

sha1 : xxxxxxxxxxx

待用

2、生成配置文件

在 Server 上生成 jupyter notebook 的配置文件

jupyter notebook --generate-config

打开默认的配置文件

vim ~/.jupyter/jupyter_notebook_config.py

然后修改如下:

c.NotebookApp.ip = '*'
c.NotebookApp.password = ' sha1:-----' #这里就是上面的字符串,这个可以设置也可以不设置
c.NotebookApp.port = 6008   # 这里的端口可以自己定义,也可以每次启动时通过控制台传参设定
c.NotebookApp.open_browser = False
c.NotebookApp.allow_remote_access = True
c.NotebookApp.allow_root = True

3、访问方法

配置阿里云安全组,防火墙开启6008端口。

在这里插入图片描述

后台启动jupyter

nohup jupyter-notebook > nohup.out &

使用nohup 和 & 后台运行jupyter notebook程序,查看、kill 进程

https://blog.csdn.net/donaldsy/article/details/96350061

客户端浏览器访问服务器域名或者IP:

就会出现jupyter登录界面,输入密码即可登录。

在这里插入图片描述

pyter登录界面,输入密码即可登录。

在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章