通过Frp进行远程连接

frp通过ssh访问内网机器的时候,还ssh隧道转发还是很相似的,先简单写一下它的远程Windows

 服务器:

[root@iZ1la3d1xbmukrZ ~]# tar -zvxf frp_0.31.1_linux_amd64.tar.gz
frp_0.31.1_linux_amd64/
frp_0.31.1_linux_amd64/frps_full.ini
frp_0.31.1_linux_amd64/frps.ini
frp_0.31.1_linux_amd64/frpc
frp_0.31.1_linux_amd64/frpc_full.ini
frp_0.31.1_linux_amd64/frps
frp_0.31.1_linux_amd64/LICENSE
frp_0.31.1_linux_amd64/frpc.ini
frp_0.31.1_linux_amd64/systemd/
frp_0.31.1_linux_amd64/systemd/frpc@.service
frp_0.31.1_linux_amd64/systemd/frpc.service
frp_0.31.1_linux_amd64/systemd/frps.service
frp_0.31.1_linux_amd64/systemd/frps@.service
[root@iZ1la3d1xbmukrZ ~]# cd frp_0.31.1_linux_amd64
[root@iZ1la3d1xbmukrZ frp_0.31.1_linux_amd64]# ll
total 21464
-rwxrwxr-x 1 1000 1000 10608640 Jan  6 16:02 frpc
-rw-rw-r-- 1 1000 1000     7447 Jan  6 16:04 frpc_full.ini
-rw-rw-r-- 1 1000 1000      126 Jan  6 16:04 frpc.ini
-rwxrwxr-x 1 1000 1000 11333632 Jan  6 16:02 frps
-rw-rw-r-- 1 1000 1000     2514 Jan  6 16:04 frps_full.ini
-rw-rw-r-- 1 1000 1000       26 Jan  6 16:04 frps.ini
-rw-rw-r-- 1 1000 1000    11358 Jan  6 16:04 LICENSE
drwxrwxr-x 2 1000 1000     4096 Jan  6 16:04 systemd
[root@iZ1la3d1xbmukrZ frp_0.31.1_linux_amd64]# vim start.sh
[root@iZ1la3d1xbmukrZ frp_0.31.1_linux_amd64]# chmod u+x start.sh
[root@iZ1la3d1xbmukrZ frp_0.31.1_linux_amd64]# ./start.sh
[root@iZ1la3d1xbmukrZ frp_0.31.1_linux_amd64]# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      31382/sshd
tcp        0      0 0.0.0.0:2181            0.0.0.0:*               LISTEN      7840/java
tcp        0      0 0.0.0.0:8848            0.0.0.0:*               LISTEN      13320/java
tcp        0      0 0.0.0.0:38480           0.0.0.0:*               LISTEN      7840/java
tcp6       0      0 :::7000                 :::*                    LISTEN      5243/./frps
tcp6       0      0 :::8080                 :::*                    LISTEN      1677/docker-proxy-c
[root@iZ1la3d1xbmukrZ frp_0.31.1_linux_amd64]#  

脚本内容:

[root@iZ1la3d1xbmukrZ frp_0.31.1_linux_amd64]# cat start.sh
nohup ./frps -c frps.ini &>/dev/null &
[root@iZ1la3d1xbmukrZ frp_0.31.1_linux_amd64]#

Windows客户端:  

 启动,然后可以进行远程连接

C:\Users\asus\Desktop\玩\frp\frp_0.31.1_windows_amd64>frpc.exe -c frpc.ini
2020/05/07 22:22:52 [I] [service.go:250] [7b7a3f42df81197f] login to server success, get run id [7b7a3f42df81197f], server udp port [0]
2020/05/07 22:22:52 [I] [proxy_manager.go:144] [7b7a3f42df81197f] proxy added: [ssh]
2020/05/07 22:22:52 [I] [control.go:164] [7b7a3f42df81197f] [ssh] start proxy success
posted @ 2020-05-07 22:38  天宇轩-王  阅读(1832)  评论(0编辑  收藏  举报