FRP反向代理 连接内网服务器上的jupyter

前言

服务器只能校内登录,现在都在校外实习挺麻烦的。利用FRP可以反向代理,然后利用SSH端口映射。不用新开端口就可以直接访问jupyter notebook。

FRP反向代理

公网中继服务器端

编辑配置文件 frps.ini

[common]
bind_port = 7000

运行命令

nohup ./frps -c frps.ini &

内网服务器端

编辑配置文件frpc.ini

[common]
server_addr = fengbohan.com
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

[jupyter notebook]
type = tcp
local_ip = 127.0.0.1
local_port = 3760
remote_port = 3760

运行命令

nohup ./frpc -c frpc.ini &

外网客户端

这部分参考了文献1的方法。

# 第一步:启动jupytermotebook
jupyter notebook --no-browser --port=8889
# 第二部:在终端中启动SSH 端口映射
ssh -p 6000 -N -f -L localhost:8888:localhost:8889 remote_user@remote_host

远端端口是8889,本地的端口号的8888。remote_user@remote_host 用实际的远程帐户和远程地址替换。

参考文献

  1. 通过SSH远程使用jupyter notebook

猜你喜欢

转载自blog.csdn.net/weixin_44681954/article/details/121962161