github下载地址 Releases · fatedier/frp · GitHub
linux服务端安装
export FRP_VERSION=0.29.1
sudo mkdir -p /etc/frp
cd /etc/frp
sudo wget "https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_amd64.tar.gz"
sudo tar xzvf frp_${FRP_VERSION}_linux_amd64.tar.gz
sudo mv frp_${FRP_VERSION}_linux_amd64/* /etc/frp
启动 ./frps -c ./frps.ini,linux后台启动 nohup command
查看frp进程 ps -ef |grep frp 第二列是进程id
结束进程kill -9 进程id
客户端配置 远程连接和https连接
[common]
server_addr = x.x.x.x
server_port = xxxx
[company_desk]
type = tcp
local_ip = 127.0.0.1
local_port = 3389
remote_port = xxxx
[company_svn]
type = https
local_ip = 192.168.2.88
local_port = 443
remote_port = 7103
custom_domains = www.xxx.com
服务端配置
[common]
bind_port = 7000
vhost_https_port = 7000
vhost_http_port = 7000
dashboard_port=7010
dashboard_user=xxx
dashboard_pwd=xxx
winsw配置开机启动frp,下载地址:Releases · winsw/winsw · GitHub
配置文件和exe一个目录
<service>
<id>frp</id>
<name>frp自动启动</name>
<description>frp自动启动</description>
<executable>frpc</executable>这里是运行的软件名
<arguments>-c frpc.ini</arguments>这里是运行的软件配置文件
<onfailure action="restart" delay="60 sec"/>
<onfailure action="restart" delay="120 sec"/>
<logmode>reset</logmode>
</service>
winsw install 安装服务
winsw uninstall 卸载服务
winsw start 开启服务
winsw stop 停止服务
winsw restart 重新启动服务
winsw status 检查服务的当前状态
最后提醒广大技术人员,内网穿透很危险,会把自己电脑暴露到外网,以前没有意识到这点,自己电脑经常开着机,想干嘛就远程一下,知道有一天电脑中了勒索病毒,所有文件都被加密了,虽然谈不上损失多少,但是引起了我的注意,以后不敢乱暴露自己的电脑了。