设置frp在ubuntu开机自启

要在 Ubuntu 上启动 FRP,您可以按照以下步骤进行操作:

  1. 下载适用于 Ubuntu 的 FRP。您可以从官方网站下载最新版本的 FRP:https://github.com/fatedier/frp/releases

  2. 解压下载的 FRP 文件。您可以使用以下命令从终端解压文件:

    tar -xzvf frp_0.33.0_linux_amd64.tar.gz

  3. 创建一个名为 "frp.service" 的文件。您可以使用以下命令创建一个新的空文件:

    sudo vim /etc/systemd/system/frp.service

在其中输入以下内容:

复制代码
  [Unit]
   Description=FRP service
   [Service]
   Type=simple
   Restart=always
   RestartSec=3
   ExecStart=/home/xiao/frp/frpc -c /home/xiao/frp/frpc.ini
   [Install]
   WantedBy=multi-user.target

然后将上面 ExecStart 行中的/home/xiao/frp替换为自己解压后 FRP 文件的路径和应用程序文件名。

  1. 保存并退出文件。

  2. 通过以下命令重新加载 systemd:

    sudo systemctl daemon-reload

6.启用 FRP 服务,使其在系统启动时自动启动:

复制代码
sudo systemctl enable frp.service

7.启动 FRP 服务:

复制代码
sudo systemctl start frp.service

现在,FRP 服务将会在 Ubuntu 开机时自动启动。通过以下命令查看 FRP 服务状态:

复制代码
sudo systemctl status frp.service

如果一切正常,您将会看到服务已启动并正在运行:

相关推荐
木子欢儿8 小时前
Ubuntu 26.04 LTS 安装Python 3.12
linux·运维·服务器·python·ubuntu
2601_967979122 天前
Ubuntu部署tensorflow(CPU/GPU)方法
ubuntu·tensorflow·cpu·gpu·配置
Rabitebla2 天前
【Linux】文件篇(五):手撕简易 FILE——模拟实现 C 标准 I/O 缓冲机制
linux·服务器·c语言·笔记·学习·ubuntu
江湖有缘9 天前
基于Ubuntu部署SoduWork:企业级 AI 原生协同平台实战全流程
linux·人工智能·ubuntu·ai·soduwork
瓦瓦gogo11 天前
从一个 TypeScript 函数开始理解 MCP 协议
linux·ubuntu·typescript
鱼听禅11 天前
Ubuntu安装YOLOv8进行菌落识别训练
linux·python·yolo·ubuntu
Zucker n12 天前
文献发现、课题组织与证据可追溯的论文阅读。
论文阅读·windows·ubuntu
qq_3718021115 天前
Ubuntu Linux中安装WorkBuddy
linux·运维·服务器·ubuntu
且从容.16 天前
Ubuntu安装flume
linux·ubuntu·flume
承渊政道16 天前
Linux网络学习【Reactor反应堆模式】
linux·网络·学习·ubuntu·reactor