FRP內網穿透及自啟動


內網穿透的步驟和文件存檔

實驗室在遠方部署了電腦主機來采集數據和圖片,每次去調試會很麻煩,因而使用FRP內網穿透使得我們可以在實驗室訪問主機。

主要功能

實現遠程可訪問和開機自啟FRP程序服務

安裝和下載FRP

服務器端:

wget https://github.com/fatedier/frp/releases/download/v0.34.3/frp_0.34.3_linux_amd64.tar.gz
tar zxvf frp_0.34.3_linux_amd64.tar.gz
cd frp_0.34.3_linux_amd64/

配置:

[common]
bind_port = 7000

啟動服務:
./frps -c ./frps.ini

客戶端:

[common]
server_addr = 127.0.0.1
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

這里注意,多客戶端配置時[ssh]里面的內容是配置組名,需要和其他SSH區別開

開機啟動

https://github.com/fatedier/frp/issues/176
vi /etc/systemd/system/frps.service 新建此文件,並寫入以下內容:

[Unit]
Description=frps daemon

[Service]
Type=simple
ExecStart=/usr/bin/frps -c /etc/frps/frps.ini

[Install]
WantedBy=multi-user.target

啟動並設為開機自啟。
$ systemctl start frps
$ systemctl enable frps


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM