当前位置:网站首页>基于frp实现内网穿透——借助公网服务器实现ssh远程连接内网服务器
基于frp实现内网穿透——借助公网服务器实现ssh远程连接内网服务器
2022-07-27 12:51:00 【Winter_Prince】
设备准备
一台可以使用的公网的服务器、一台可以访问web的内网 X X X的计算机,一台可以访问web的不属于内网 X X X的计算机。
文件准备
下载对应文件 传送门
linux下进行解压的命令:
tar -zxvf frp_0.44.0_linux_amd64.tar.gz
客户端是指要被ssh访问的计算机。
服务端是指公网IP的计算机。
运行文件配置
# frps.ini
[common]
bind_port = 7000 # 公网服务器开启的端口
# frpc.ini
[common]
server_addr = # 公网服务器的IP地址
server_port = 7000 # 公网服务器开启的端口
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000 # 这个端口是用于代理的端口
文件运行
服务端运行
./frps -c ./frps.ini
客户端运行
./frpc -c ./frpc.ini
非内网计算机ssh连接
ssh -oPort=6000 [email protected] #x.x.x.x是公网服务器的IP
开启端口
查看是否连接成功,如果没有成功,要检查一下公网服务器的防火墙的端口是否打开。
6000和7000的端口都要打开。
netstat -ntulp # 查询已开放的端口
netstat -ntulp | grep 端口号 # 可以具体查看某一个端口号
firewall-cmd --query-port=6000/tcp # 查询指定端口是否已开,提示 yes,表示开启;no表示未开启。
firewall-cmd --add-port=6000/tcp --permanent # 添加指定需要开放的端口
firewall-cmd --add-port=7000/tcp --permanent # 添加指定需要开放的端口
firewall-cmd --reload # 重载入添加的端口
firewall-cmd --query-port=6000/tcp # 查询指定端口是否开启成功
firewall-cmd --permanent --remove-port=6000/tcp # 移除指定端口
firewall-cmd --permanent --remove-port=7000/tcp # 移除指定端口
备注:运行公网服务器为ubuntu20.04,指令集是amd64的,如果需要其他架构,可以访问 仓库进行下载对应架构的软件版本,版本不对应会出现core dump之类的运行报错。
边栏推荐
- Talk about one of the important classes of feign components, reactivefeign
- What should I do if I can't see any tiles on SAP Fiori launchpad?
- SCI论文写作
- feign的动态代理
- Forward pre check and reverse pre check
- Gartner authority predicts eight development trends of network security in the next four years
- Sff1004-mhchxm diode sff1004
- Preliminary discussion on NetGen and Gmsh mesh generation of any multiple sub models of CAD based on osg+occ
- v-show
- 面试考点:三种图的问题
猜你喜欢

SCI论文写作

Pat class B 1109 good at C (detailed)

Open source project - taier1.2 release, new workflow, tenant binding simplification and other functions

How to debug JNI program

Getting started for beginners: build your own blog with WordPress
![52: Chapter 5: developing admin management services: 5: developing [paging query admin account list, interface]; (swagger's @apiparam(), annotate the method parameters; PageHelper paging plug-in; Inte](/img/08/1cc315d568673a3892c20bc1254d38.png)
52: Chapter 5: developing admin management services: 5: developing [paging query admin account list, interface]; (swagger's @apiparam(), annotate the method parameters; PageHelper paging plug-in; Inte

Sff1004-mhchxm diode sff1004

Is it easy to find a job after programmer training and learning

字节跳动的 Flink OLAP 作业调度和查询执行优化实践

电滑环的常用类型
随机推荐
相对定位
clear
实现新增加硬盘的磁盘分区和文件系统挂载
湖仓一体电商项目背景与架构介绍及基础环境准备
数据库HTAP能力强弱怎么看
Musk was exposed to be the founder of Google: he broke up his best friend's second marriage and knelt down to beg for forgiveness
18. Text processing tool -grep
正向预查和反向预查
SQL GROUP BY语句
[nuxt 3] (XII) project directory structure 2
粘制定位
multi-table query
Fixed positioning
Interview site: three kinds of questions
feign client三个客户端的自动装配
Write a program, accept a string consisting of letters, numbers and spaces, and a character, and then output the number of characters in the input string. Case insensitive.
POJ2594 Treasure Exploration【二分图最小路径覆盖】【Floyd】
【基础知识】~ 集成电路设计流程,以及各阶段所使用的EDA工具
clearfix的作用
52:第五章:开发admin管理服务:5:开发【分页查询admin账号列表,接口】;(Swagger的@ApiParam(),对方法参数进行注释;PageHelper分页插件;拦截器拦截检查登录状态)