linux(Ubuntu) Frp后台自動啟動的方法


背景提要

      操作系統 Ubuntu, 目的是讓我的 frp 后台啟動不妨礙我干其他事,同時能自啟動,畢竟服務器那邊常常維護重啟啥的。

在這里插入圖片描述

步驟

  1. 登錄服務器,輸入sudo vim /lib/systemd/system/frps.service 其實就是在 root/lib/systemd/system 下面新建一個文件frps.service
    在這里插入圖片描述
    在這里插入圖片描述

  2. 在文件里面寫入以下內容

[Unit]
Description=frps daemon

[Service]
Type=simple
#此處把/root/frp_linux_arm64替換成 你的frps的實際安裝目錄
ExecStart=/root/frp_linux_arm64/frps -c /root/frp_linux_arm64/frps.ini

[Install]
WantedBy=multi-user.target

      你的安裝目錄可以這樣得到,到你安裝 frps 的目錄下 輸入pwd
在這里插入圖片描述

  1. 然后就啟動frps sudo systemctl start frps
  2. 再打開自啟動 sudo systemctl enable frps

      搞定收工

其他

  • 重啟應用 sudo systemctl restart frps
  • 停止應用 sudo systemctl stop frps
  • 查看日志 sudo systemctl status frps

參考文獻

      https://github.com/fatedier/frp/issues/176

      https://gist.github.com/ihipop/4dc607caef7c874209521b10d18e35af


免責聲明!

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



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