FRPS
服务器端
# 从官方github下载服务器端frp并解压
[root@BlogSystem software]# wget https://github.com/fatedier/frp/releases/download/v0.21.0/frp_0.21.0_linux_amd64.tar.gz
[root@BlogSystem software]# tar -zxvf frp_0.21.0_linux_amd64.tar.gz
[root@BlogSystem software]# mv frp_0.21.0_linux_amd64 frp
# 修改配置文件
[root@BlogSystem software]# vim /software/frp/frps.ini
[common]
bind_port = 7000
dashboard_user = admin
dashboard_pwd = tutuabc123
dashboard_port = 7500
# 开放权限
[root@BlogSystem frp]# chmod -R 777 /software/frp
# 守护进程的方式启动服务
[root@BlogSystem frp]#nohup ./frps -c frps.ini >/dev/null 2>&1 &
2019/12/30 13:17:54 [I] [service.go:130] frps tcp listen on 0.0.0.0:7000
2019/12/30 13:17:54 [I] [service.go:216] Dashboard listen on 0.0.0.0:7500
2019/12/30 13:17:54 [I] [root.go:207] Start frps success
开发防火墙规则
公网测试
ip:port
客户端
# 右键解压
# 进入文件夹修改frpc.ini
[common]
server_addr = # frps_ip
server_port = 7000
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
[RDP]
type = tcp
local_ip = 127.0.0.1
local_port = 3389
remote_port = 7001
# shift右键通过PowerShell打开终端,执行命令
PS E:\Tools\Frpc\frp_0.21.0_windows_amd64> .\frpc.exe -c frpc.ini
2019/12/30 13:46:48 [I] [proxy_manager.go:300] proxy removed: []
2019/12/30 13:46:48 [I] [proxy_manager.go:310] proxy added: [ssh RDP]
2019/12/30 13:46:48 [I] [proxy_manager.go:333] visitor removed: []
2019/12/30 13:46:48 [I] [proxy_manager.go:342] visitor added: []
2019/12/30 13:46:50 [I] [control.go:246] [ac575f48e7937df9] login to server success, get run id [ac575f48e7937df9], server udp port [0]
2019/12/30 13:46:50 [I] [control.go:169] [ac575f48e7937df9] [ssh] start proxy success
2019/12/30 13:46:50 [I] [control.go:169] [ac575f48e7937df9] [RDP] start proxy success
防火墙
firewall-cmd --zone=public --add-port=7000/tcp --permanent
firewall-cmd --reload
windows 连接不上的问题
网络最好设置成专用网络,公共网络貌似不支持远程桌面。
1、进入组策略,“Win+R”→“gpedit.msc”
2、“计算机配置”→“Window设置”→“安全设置”→“本地策略”→“安全选项”→“网络访问:本地账户的共享和安全模型”→设置为“经典-对本地用户进行身份验证,不改变起本来身份”
3、保存即可