1.下載frp
下載系統(tǒng)對應(yīng)的frp 安裝包
2.安裝jupyte
## 安裝jupyter
conda install -y jupyter
## 生成配置文件
jupyter notebook --generate-config
## 生成密碼
jupyter notebook password
Enter password: xxxx
Verify password: xxxx
## 修改jupyter 配置設(shè)置
vi ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.allow_remote_access = True
c.NotebookApp.ip='*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8890
c.NotebookApp.terminals_enabled = True
3.配置IP 端口
在公網(wǎng)IP服務(wù)器 中修改目錄中的 frps.ini 配置文件;在內(nèi)網(wǎng)IP服務(wù)器 中修改 frpc.ini配置文件。
### 公網(wǎng):frps.ini
[common]
bind_port = 7000
vhost_http_port = 8890
# 下面的是配置可視化界面的,可以通過你的ip:7500訪問
dashboard_port = 7500
dashboard_user = mint
dashboard_pwd = xxxxx
### 內(nèi)網(wǎng):frpc.ini
[common]
server_addr = 公網(wǎng)IP
server_port = 7000
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
[jupyter]
type = http
local_ip = 127.0.0.1
local_port = 8890
custom_domains = 公網(wǎng)IP
4.啟動服務(wù)
公網(wǎng)服務(wù)器: nohup ./frps -c ./frps.ini > /dev/null 2>&1 & ;
內(nèi)網(wǎng)服務(wù)器: nohup ./frpc -c ./frpc.ini > /dev/null 2>&1 & ;
啟動jupyter服務(wù): nohup ./jupyter notebook >/dev/null 2>&1 &。
5.連接訪問
SSH 訪問內(nèi)網(wǎng)服務(wù)器, username 是內(nèi)網(wǎng)服務(wù)器用戶名,后面的IP地址則是公網(wǎng)服務(wù)器的IP地址 ssh -oPort 6000 username@IP;瀏覽器訪問IP:8890訪問jupyter服務(wù);瀏覽器訪問IP:7500訪問frps DashBoard。