利用vps實現訪問公司內網windows遠程桌面
阿新 • • 發佈:2018-06-08
馬哥教育 linux 服務端:vps
客戶端:windows主機
客戶端:windows主機
vps安裝、配置、後臺運行frp server。
- 訪問https://github.com/fatedier/frp/releases 獲取vps系統對應的frp程序包。
- 連接vps,下載對應的程序包。
~]# wget https://github.com/fatedier/frp/releases/download/v0.20.0/frp_0.20.0_linux_amd64.tar.gz
-
配置frps.ini, 表示frp server端配置文件。
~]# vim frps.ini [common] bind_port = 7000 # vps需要監聽的端口,用於和frp 客戶端連接。
- 啟動服務,作為後臺運行
nohup frp/frps -c frp/frps.ini & &> /dev/null
windows安裝、配置、開機自啟動運行frp client。
- 訪問https://github.com/fatedier/frp/releases 獲取vps系統對應的frp程序包。
- 配置frpc.ini, 表示frp server端配置文件。
[common] server_addr = 107.172.67.xx #服務器的IP server_port = 7000 #服務器監聽的port [rdp] type = tcp local_ip = 127.0.0.1 local_port = 3389 # 當用戶連接以下 frp server的5200端口時,會被轉發到frp client的3389端口。 remote_port = 5200 # 服務器被連接的端口,在與server建立連接後,server會監聽於此端口用於被用戶連接。
- 寫一個bat腳本用於啟動frp client.
編輯一個文件,frp.bat @echo off start "C:\Windows\System32\cmd.exe" cd C:\Users\Administrator\Desktop\frp_0.20.0_windows_amd64\frp_0.20.0_windows_amd64 frpc -c frpc.ini exit
註意: C:\Users\Administrator\Desktop\frp_0.20.0_windows_amd64\frp_0.20.0_windows_amd64 此處目標目錄是frpc程序所在的目錄
- 將其添加至服務。
C:\Users\Administrator>sc create frp binPath= C:\Users\Administrator\Desktop\fr p.bat start= auto
註意:binPath= 此處的值是上面frp.bat的絕對路徑。
- 查看開機自啟服務是否有添加的frp服務,運行: msconfig
- 重啟電腦
- 訪問遠程桌面,(註意不能在本機訪問註意端口是remote_port)
利用vps實現訪問公司內網windows遠程桌面