使用gost进行内网端口转发并配置jupyter notebook
# jupyter安装步骤
conda install jupyterlab
# ipython
from notebook.auth import passwd
passwd()
# jupyter lab --generate-config (vi /root/.jupyter/jupyter_notebook_config.py)
# 将ip设置为*,意味允许任何IP访问
c.NotebookApp.ip = '*'
# 这里的密码就是上边生成的字符串
c.NotebookApp.password = 'sha1:f704b702aea2:01e2bd991f9c720812345607810927'
# 服务器上并没有浏览器可以供Jupyter打开
c.NotebookApp.open_browser = False
# 监听端口设置为8888或其他自己喜欢的端口
c.NotebookApp.port = 8888
# 允许远程访问
c.NotebookApp.allow_remote_access = True
# 运行
jupyter lab --allow-root
nohup jupyter lab --allow-root &
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# gost配置步骤
# 安装go
snap install go --channel=1.20/stable --classic
export GOPROXY=https://goproxy.cn
# 配置 172.18.16.38:8888 是远程jupyter的地址 10.6.16.191:2222 是公网jupyter的地址
./gost -L socks5://:5555?bind=true
./gost -L rtcp://:2222/172.18.16.38:8888 -F socks5://10.6.16.191:5555
./gost -L socks5://:5556?bind=true
./gost -L rtcp://:7777/172.18.16.38:8000 -F socks5://10.6.16.191:5556
# 文档
https://blog.csdn.net/v6543210/article/details/130705592
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
# 参考
上次更新: 2023-08-23 17:09:19