【frp】内网穿透

简介

  1. 服务端:腾讯云公网服务器Ubuntu系统;
  2. 客户端:家里主机win10系统;
  3. 使用场景:在笔记本上远程操作家里主机的jupyter notebook;

服务端配置步骤

  1. 下载frp压缩包
    地址:https://github.com/fatedier/frp/releases
    方式1:本地架梯子下载后scp至服务器;
    方式2:在服务器上直接wget,比较慢;
  2. 解压
cd path_download;
tar -zxvf frp_xxxx_linux_amd64.tar.gz;
cd frp_xxxx_linux_amd64;
ls
  1. 修改配置文件frps.ini
vim frps.ini;
[common]
bind_port = 8001 # 与客户端server_port相一致
dashboard_port = 8002 # 服务器给frp的专用端口
dashboard_user = root # frp服务仪表盘访问用户
dashboard_pwd = 123456 # frp服务仪表盘访问密码
token = qwer1234 # 与客户端token相一致
tls_enable = true
privilege_mode = true
privilege_token = pwd123
  1. 启动frp
./frps -c frps.ini # 正常启动
nohup ./frps -c frps.ini >/dev/null 2>&1 & # 后台启动
  1. frp仪表盘可视化
    浏览器访问:服务器的ip:配置的dashboard_port
  2. 查看并关闭frp服务
ps -ef| grep frp # 查看
kill -9 进程号 # 关闭

客户端配置步骤

  1. 下载frp压缩包
    地址:https://github.com/fatedier/frp/releases
  2. 解压并修改配置文件frpc.ini
[common]
server_addr = xxx.xxx.xxx # 服务器地址
server_port = 8001 # 同服务端bind_port
token = qwer1234 # 同服务端token 
tls_enable = true
privilege_token = pwd123

[rbac_study]
type = tcp
local_ip = 127.0.0.1 # 本地地址,与服务器地址形成映射
local_port = 3781	# 本地端口号
remote_port = 8003 # 服务器上再给一个port与local_port形成映射
  1. 启动frp
./frpc -c ./frpc.ini # 在power shell的路径中正常启动

windows后台启动,参考:https://blog.csdn.net/weixin_40483369/article/details/128297534

远程服务测试

  1. 客户端启动jupyter
  2. 第三方笔记本访问server_addr:remote_port

问题参考

端口不通:https://www.landui.com/help/nshow-11274.html
login to server failed: https://blog.csdn.net/xuanlv_xiaoyao/article/details/131611208

其他参考

https://blog.csdn.net/weixin_44248000/article/details/132204493

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值