创新|开发|定制
专注于软路由|网络技术领域

windows使用frp映射本地3389远程桌面到远程服务器

go build:

1
2
3
4
5
6
7
git clone https://github.com/fatedier/frp.git
#windows客户端
frp/cmd/frpc
GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -ldflags "-s -w"
#linux服务端
frp/cmd/frps
go build -ldflags "-s -w"

服务端配置文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[common]
bind_addr = 0.0.0.0
bind_port = 7000
dashboard_addr = 0.0.0.0
dashboard_port = 7500
dashboard_user = admin
dashboard_pwd = admin
log_file = /run/log/frp/frps.log
# trace, debug, info, warn, error
log_level = info
log_max_days = 3
disable_log_color = false
token = password
pool_count = 5
tcp_mux = false
allow_ports = 2000-3000,3001,3003,4000-50000
max_ports_per_client = 0

客户端配置文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[common]
server_addr = www.haiyun.me
server_port = 7000
log_file = ./frpc.log
# trace, debug, info, warn, error
log_level = info
log_max_days = 3
disable_log_color = false
login_fail_exit = false
token = password
pool_count = 5
protocol = tcp
tcp_mux = false
tls_enable = false
dns_server = 114.114.114.114
admin_addr = 127.0.0.1
admin_port = 7400
admin_user = admin
admin_pwd = admin
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 3389
remote_port = 3389
use_encryption = true
use_compression = false

windows下使用winsw将frpc安装为系统服务开机自动启动,将winsw放到frp目录,并新建winsw.xml配置文件:

1
2
3
4
5
6
7
8
9
10
<service>
    <id>frp</id>
    <name>frp client</name>
    <description>frp client</description>
    <executable>C:\test\frpc.exe</executable>
    <arguments>-c frpc.ini</arguments>
    <onfailure action="restart" delay="60 sec"/>
    <logmode>append</logmode>
    <logpath>logs</logpath>
</service>

以管理员启动cmd进入frp目录,安装frp为系统服务并启动:

1
2
3
cd C:\test\
winsw install
winsw start frp
赞(0) 打赏
转载请注明出处:Ros资源网 » windows使用frp映射本地3389远程桌面到远程服务器

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏